diff --git a/.github/release-please-config.json b/.github/release-please-config.json new file mode 100644 index 0000000..d9db315 --- /dev/null +++ b/.github/release-please-config.json @@ -0,0 +1,21 @@ +{ + "release-type": "ruby-yoshi", + "draft": true, + "prerelease": false, + "bump-minor-pre-major": true, + "bump-patch-for-minor-pre-major": true, + "include-component-in-tag": false, + "include-v-in-tag": true, + "skip-github-release": false, + "separate-pull-requests": false, + "tag-separator": "/", + "sequential-calls": false, + "packages": { + ".": { + "package-name": "xdr", + "changelog-path": "CHANGELOG.md", + "version-file": "lib/xdr/version.rb" + } + }, + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json" +} diff --git a/.github/release-please-manifest.json b/.github/release-please-manifest.json new file mode 100644 index 0000000..930cf0f --- /dev/null +++ b/.github/release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "3.0.3" +} diff --git a/.github/release-please.yml b/.github/release-please.yml new file mode 100644 index 0000000..690b02c --- /dev/null +++ b/.github/release-please.yml @@ -0,0 +1,5 @@ +primaryBranch: main +handleGHRelease: true +manifest: true +manifestConfig: .github/release-please-config.json +manifestFile: .github/release-please-manifest.json diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index e02918a..386fb8c 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -1,17 +1,45 @@ name: release-please - on: push: - branches: [ main ] + branches: [main] workflow_dispatch: +permissions: + contents: write + pull-requests: write + jobs: release-please: + if: ${{ github.repository == 'astroband/ruby-xdr' }} runs-on: ubuntu-latest steps: - - id: release - uses: google-github-actions/release-please-action@v3 - with: - release-type: ruby - bump-minor-pre-major: true - version-file: "lib/xdr/version.rb" + - uses: google-github-actions/release-please-action@v4 + id: release + with: + token: ${{ secrets.RELEASE_PLEASE_TOKEN }} + config-file: .github/release-please-config.json + manifest-file: .github/release-please-manifest.json + outputs: + release_created: ${{ steps.release.outputs.release_created }} + release_tag_name: ${{ steps.release.outputs.tag_name }} + + push-gem: + needs: release-please + runs-on: ubuntu-latest + if: ${{ needs.release-please.outputs.release_created }} + + permissions: + contents: write + id-token: write + + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ needs.release-please.outputs.release_tag_name }} + + - uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + ruby-version: ruby + + - uses: rubygems/release-gem@v1