-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #9 --------- Signed-off-by: Edoardo Vacchi <[email protected]>
- Loading branch information
Showing
2 changed files
with
103 additions
and
44 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 |
---|---|---|
@@ -0,0 +1,80 @@ | ||
name: release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
release-version: | ||
description: 'Version being released' | ||
required: true | ||
branch: | ||
description: 'Branch to release from' | ||
required: true | ||
default: 'main' | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install libextism | ||
uses: ./.github/actions/libextism | ||
|
||
- name: Setup Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: 21 | ||
distribution: 'temurin' | ||
server-id: ossrh | ||
server-username: MAVEN_USERNAME | ||
server-password: MAVEN_PASSWORD | ||
gpg-private-key: ${{ secrets.JRELEASER_GPG_SECRET_KEY }} | ||
gpg-passphrase: MAVEN_GPG_PASSPHRASE | ||
|
||
- id: install-secret-key | ||
name: Install gpg secret key | ||
run: | | ||
cat <(echo -e "${{ secrets.JRELEASER_GPG_SECRET_KEY }}") | gpg --batch --import | ||
gpg --list-secret-keys --keyid-format LONG | ||
- name: Compile | ||
run: mvn --batch-mode --no-transfer-progress verify | ||
|
||
- name: Setup Git | ||
run: | | ||
git config user.name "Extism BOT" | ||
git config user.email "[email protected]" | ||
- name: Set the version | ||
run: | | ||
mvn --batch-mode --no-transfer-progress versions:set -DgenerateBackupPoms=false -DnewVersion=${{ github.event.inputs.release-version }} | ||
env: | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
|
||
- name: Release to Maven Central | ||
run: | | ||
mvn --batch-mode --no-transfer-progress -Prelease clean verify deploy -X | ||
env: | ||
MAVEN_USERNAME: ${{ secrets.JRELEASER_NEXUS2_USERNAME }} | ||
MAVEN_PASSWORD: ${{ secrets.JRELEASER_NEXUS2_PASSWORD }} | ||
MAVEN_GPG_PASSPHRASE: ${{ secrets.JRELEASER_GPG_PASSPHRASE }} | ||
|
||
- name: Commit tag, back to Snapshot and Push | ||
if: ${{ ! endsWith(github.event.inputs.release-version, '-SNAPSHOT') }} | ||
run: | | ||
git add . | ||
git commit -m "Release version update ${{ github.event.inputs.release-version }}" | ||
git tag ${{ github.event.inputs.release-version }} | ||
mvn --batch-mode --no-transfer-progress versions:set -DgenerateBackupPoms=false -DnewVersion=999-SNAPSHOT | ||
git add . | ||
git commit -m "Snapshot version update" | ||
git push | ||
git push origin ${{ github.event.inputs.release-version }} | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} |
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