diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index 477dc6d..e81a223 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -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 " + changelog-notes-type: github + prerelease: true diff --git a/.github/workflows/please-release.yml b/.github/workflows/please-release.yml index fb2d4aa..ddf02b5 100644 --- a/.github/workflows/please-release.yml +++ b/.github/workflows/please-release.yml @@ -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 " - 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/publish-gem-to-github@v1.0.6 with: - release-type: ruby - package-name: kitchen-hyperv - version-file: lib/kitchen/driver/hyperv_version.rb - token: ${{ secrets.PUBLISH_WORKFLOW_TOKEN }} - signoff: "Dan Webb " - 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/publish-gem-to-rubygems@v1.0.1 + with: + api_key: ${{ secrets.RUBY_GEMS_API_KEY }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 8e3beb6..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,28 +0,0 @@ ---- -name: Publish - -"on": - release: - types: [published] - -jobs: - publish-to-github: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Build and publish to GitHub Package - uses: actionshub/publish-gem-to-github@v1.0.6 - with: - 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 - uses: actionshub/publish-gem-to-rubygems@v1.0.1 - with: - api_key: ${{ secrets.RUBY_GEMS_API_KEY }}