Skip to content

Commit

Permalink
fix!: Move release and upload into the please-release step
Browse files Browse the repository at this point in the history
- Allows us to also upload the gem artifact to the releases page

Signed-off-by: Dan Webb <[email protected]>
  • Loading branch information
damacus committed Aug 24, 2023
1 parent 7242da2 commit e13f255
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 40 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,17 @@ name: "Lint Unit"
jobs:
lint-unit:
uses: test-kitchen/.github/.github/workflows/lint-unit.yml@main

pre-release:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
release-type: ruby
package-name: kitchen-hyperv
version-file: lib/kitchen/driver/hyperv_version.rb
token: ${{ secrets.PUBLISH_WORKFLOW_TOKEN }}
signoff: "Dan Webb <[email protected]>"
changelog-notes-type: github
prerelease: true
38 changes: 26 additions & 12 deletions .github/workflows/please-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,47 @@
"on":
push:
branches: [main]
pull_request:

name: release-please
jobs:
release-please:
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/main'
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
release-type: ruby
package-name: kitchen-hyperv
version-file: lib/kitchen/driver/hyperv_version.rb
token: ${{ secrets.PUBLISH_WORKFLOW_TOKEN }}
signoff: "Dan Webb <[email protected]>"
prerelease: true
changelog-notes-type: github

release-please-main:
- name: Upload Release Artifact
if: ${{ steps.release.outputs.release_created }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
find . -name '*.gemspec' -maxdepth 1 -exec gem build {} \;
gh release upload ${{ steps.release.outputs.tag_name }} *.gem
publish-to-github:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- uses: google-github-actions/release-please-action@v3
- uses: actions/checkout@v3
- name: Build and publish to GitHub Package
if: ${{ steps.release.outputs.release_created }}
uses: actionshub/[email protected]
with:
release-type: ruby
package-name: kitchen-hyperv
version-file: lib/kitchen/driver/hyperv_version.rb
token: ${{ secrets.PUBLISH_WORKFLOW_TOKEN }}
signoff: "Dan Webb <[email protected]>"
changelog-notes-type: github
token: ${{ secrets.GITHUB_TOKEN }}
owner: ${{ secrets.OWNER }}

publish-to-rubygems:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build and publish to RubyGems
if: ${{ steps.release.outputs.release_created }}
uses: actionshub/[email protected]
with:
api_key: ${{ secrets.RUBY_GEMS_API_KEY }}
28 changes: 0 additions & 28 deletions .github/workflows/publish.yml

This file was deleted.

0 comments on commit e13f255

Please sign in to comment.