-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
39 additions
and
13 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 |
---|---|---|
@@ -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/[email protected] | ||
|
@@ -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 [email protected] | ||
git checkout -b releases/${{ env.RELEASE_VERSION }} | ||
git push origin releases/${{ env.RELEASE_VERSION }} | ||
- name: Import GPG Key | ||
uses: crazy-max/[email protected] | ||
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/[email protected] | ||
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 | ||
|
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 |
---|---|---|
|
@@ -7,7 +7,7 @@ on: | |
|
||
jobs: | ||
publish_snapshot: | ||
runs-on: macOS-latest | ||
runs-on: macos-latest | ||
|
||
steps: | ||
- uses: actions/[email protected] | ||
|
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