diff --git a/.github/workflows/publish_release.yml b/.github/workflows/publish_release.yml index ef9e4d4..095001c 100644 --- a/.github/workflows/publish_release.yml +++ b/.github/workflows/publish_release.yml @@ -1,9 +1,7 @@ name: Publish a release on: - push: - branches: - - release + workflow_dispatch: env: VERSION_FILE: gradle.properties @@ -13,7 +11,7 @@ env: jobs: publish_artifacts: - runs-on: macOS-latest + runs-on: macos-latest steps: - uses: actions/checkout@v3.5.3 @@ -75,21 +73,42 @@ jobs: version-file: ${{ env.VERSION_FILE }} version-file-extraction-pattern: ${{ env.VERSION_EXTRACT_PATTERN }} + - name: Create, checkout, and push release branch + run: | + git config user.name eygraber + git config user.email 1100381+eygraber@users.noreply.github.com + git checkout -b releases/${{ env.RELEASE_VERSION }} + git push origin releases/${{ env.RELEASE_VERSION }} + + - name: Import GPG Key + uses: crazy-max/ghaction-import-gpg@v5.3.0 + with: + gpg_private_key: ${{ secrets.GIT_SIGNING_PRIVATE_KEY }} + passphrase: ${{ secrets.GIT_SIGNING_PRIVATE_KEY_PASSWORD }} + git_user_signingkey: true + git_commit_gpgsign: true + git_tag_gpgsign: true + + - name: Store SHA of HEAD commit on ENV + run: echo "GIT_HEAD=$(git rev-parse HEAD)" >> $GITHUB_ENV + - name: Create tag id: create_tag - uses: actions/github-script@v6.4.1 + uses: actions/github-script@v6 with: + github-token: ${{ secrets.PUSH_PAT }} script: | + const {GIT_HEAD} = process.env github.rest.git.createRef({ owner: context.repo.owner, repo: context.repo.repo, ref: "refs/tags/${{ env.RELEASE_VERSION }}", - sha: context.sha + sha: `${GIT_HEAD}` }) - name: Build changelog id: build_changelog - uses: mikepenz/release-changelog-builder-action@v3.7.2 + uses: mikepenz/release-changelog-builder-action@v4 with: configuration: "changelog_config.json" toTag: ${{ env.RELEASE_VERSION }} @@ -101,14 +120,13 @@ jobs: uses: ncipollo/release-action@v1.12.0 with: body: ${{ steps.build_changelog.outputs.changelog }} - commit: release name: Release ${{ env.RELEASE_VERSION }} tag: ${{ env.RELEASE_VERSION }} - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.PUSH_PAT }} - - uses: actions/checkout@v3.5.3 + - uses: actions/checkout@v3 with: - ref: 'master' + ref: ${{ github.event.head_ref }} token: ${{ secrets.PUSH_PAT }} - name: Prepare next dev version @@ -119,7 +137,7 @@ jobs: - name: Commit next dev version id: commit_next_dev - uses: EndBug/add-and-commit@v9.1.3 + uses: EndBug/add-and-commit@v9 with: add: "['gradle.properties', 'README.md']" default_author: github_actions diff --git a/.github/workflows/publish_snapshot_release.yml b/.github/workflows/publish_snapshot_release.yml index e4c74fb..a2a33e4 100644 --- a/.github/workflows/publish_snapshot_release.yml +++ b/.github/workflows/publish_snapshot_release.yml @@ -7,7 +7,7 @@ on: jobs: publish_snapshot: - runs-on: macOS-latest + runs-on: macos-latest steps: - uses: actions/checkout@v3.5.3 diff --git a/changelog_config.json b/changelog_config.json index 9b403c1..1273aa5 100644 --- a/changelog_config.json +++ b/changelog_config.json @@ -27,6 +27,14 @@ { "title": "\uD83D\uDCE6 Dependencies", "labels": ["dependencies"] + }, + { + "title": "## \uD83D\uDCA5 GitHub Actions", + "labels": ["gh-actions"] + }, + { + "title": "## \uD83D\uDC18 Gradle Improvements", + "labels": ["gradle"] } ], "ignore_labels": [