Skip to content

Commit

Permalink
refactoring the action to be trigger once new tag is pushed then:
Browse files Browse the repository at this point in the history
- it will create new release
- push into maven
  • Loading branch information
elkezza committed Aug 7, 2024
1 parent f10e06d commit 9e27228
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 27 deletions.
27 changes: 0 additions & 27 deletions .github/workflows/publish_maven_central.yml

This file was deleted.

49 changes: 49 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Create Release on Tag

on:
push:
tags:
- 'v*.*.*'

jobs:
create_release:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0

- name: Set up GitHub CLI
uses: sersoft-gmbh/setup-gh-cli-action@v2
with:
version: stable

- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG_NAME=$(git describe --tags)
RELEASE_TITLE="Release ${TAG_NAME}"
RELEASE_NOTES="See the [CHANGELOG](https://github.com/exoscale/exoscale4j/blob/main/CHANGELOG.md) for details."
gh release create "${TAG_NAME}" --title "${RELEASE_TITLE}" --notes "${RELEASE_NOTES}"
# Set up JDK 11
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
server-id: 'central'
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_KEYRING }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Publish package
run: mvn --batch-mode deploy --file sdk/pom.xml -Psign-artifacts
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD}}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}

0 comments on commit 9e27228

Please sign in to comment.