Skip to content

Commit

Permalink
Chore: CI Update for please release and Devcontainer addition of act (
Browse files Browse the repository at this point in the history
#127)

- Update CI with please release
- Add devcontainer features for local testing of github actions
  • Loading branch information
mdp committed May 31, 2023
1 parent 2425911 commit b38a738
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
// "postCreateCommand": "ruby --version",

// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
"remoteUser": "vscode",
"features": {
"ghcr.io/devcontainers-contrib/features/act:1": {},
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
}

}
42 changes: 42 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Release

on:
push:
branches:
- 'main'
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
release-type: ruby
package-name: rotp
version-file: "lib/rotp/version.rb"
# Checkout code if release was created
- uses: actions/checkout@v2
if: ${{ steps.release.outputs.release_created }}
# Setup ruby if a release was created
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.2
bundler-cache: true
if: ${{ steps.release.outputs.release_created }}
- name: Run tests
run: bundle exec rspec
if: ${{ steps.release.outputs.release_created }}
# Publish
- name: publish gem
run: |
mkdir -p $HOME/.gem
touch $HOME/.gem/credentials
chmod 0600 $HOME/.gem/credentials
printf -- "---\n:rubygems_api_key: ${RUBYGEMS_AUTH_TOKEN}\n" > $HOME/.gem/credentials
gem build *.gemspec
gem push *.gem
env:
# Make sure to update the secret name
# if yours isn't named RUBYGEMS_AUTH_TOKEN
RUBYGEMS_AUTH_TOKEN: "${{secrets.RUBYGEMS_AUTH_TOKEN}}"
if: ${{ steps.release.outputs.release_created }}

0 comments on commit b38a738

Please sign in to comment.