-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: enable GH actions to replace Travis CI.
- Loading branch information
Showing
3 changed files
with
73 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: Release | ||
on: | ||
push: | ||
branches: | ||
- "master" # main only | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: GoogleCloudPlatform/release-please-action@v2 | ||
id: release | ||
with: | ||
release-type: ruby | ||
package-name: "pwqgen.rb" | ||
bump-minor-pre-major: true | ||
bump-patch-for-minor-pre-major: true | ||
version-file: "lib/pwqgen/version.rb" | ||
|
||
# Checkout code | ||
- uses: actions/checkout@v4 | ||
if: ${{ steps.release.outputs.release_created }} | ||
|
||
# Setup ruby | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
bundler-cache: true | ||
if: ${{ steps.release.outputs.release_created }} | ||
- name: Run tests | ||
run: | | ||
bundle exec rake test | ||
if: ${{ steps.release.outputs.release_created }} | ||
|
||
# Publish if release was created | ||
- name: publish gem | ||
run: | | ||
mkdir -p $HOME/.gem | ||
touch $HOME/.gem/credentials | ||
chmod 0600 $HOME/.gem/credentials | ||
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials | ||
bundle exec rake build | ||
gem push pkg/*.gem | ||
env: | ||
# Make sure to update the secret name | ||
# if yours isn't named RUBYGEMS_AUTH_TOKEN | ||
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_AUTH_TOKEN}}" | ||
if: ${{ steps.release.outputs.release_created }} | ||
|
||
- name: Upload Release Artifact | ||
if: ${{ steps.release.outputs.release_created }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | ||
gh release upload ${{ steps.release.outputs.tag_name }} pkg/*.gem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Run tests | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
run-tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
bundler-cache: true | ||
- name: Run tests | ||
run: | | ||
bundle exec rake test |
This file was deleted.
Oops, something went wrong.