This repository has been archived by the owner on Oct 4, 2024. It is now read-only.
fix: tests #7
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
name: Publish | |
on: | |
push: | |
branches: | |
- main | |
concurrency: | |
group: ${{ github.ref }}-${{ github.workflow }} | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
environment: Production | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Import GPG key | |
id: import_gpg | |
uses: crazy-max/ghaction-import-gpg@v6 | |
with: | |
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
passphrase: ${{ secrets.GPG_PASSPHRASE }} | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '21' | |
distribution: 'corretto' | |
server-id: ossrh | |
server-username: MAVEN_USERNAME | |
server-password: MAVEN_PASSWORD | |
- name: Maven Package | |
run: mvn clean package | |
- name: Maven Publish | |
run: mvn --batch-mode clean deploy | |
env: | |
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} | |
release: | |
needs: publish | |
runs-on: ubuntu-latest | |
environment: Production | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install xmlstarlet | |
run: sudo apt-get update && sudo apt-get install -y xmlstarlet | |
- name: Get Version | |
id: semver | |
uses: ietf-tools/semver-action@v1 | |
with: | |
token: ${{ github.token }} | |
branch: main | |
- name: Create Tag | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git tag -a ${{ steps.semver.outputs.nextStrict }} -m "Release ${{ steps.semver.outputs.nextStrict }}" | |
git push origin ${{ steps.semver.outputs.nextStrict }} | |
- name: Create Release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh auth login --with-token <<< "${GITHUB_TOKEN}" | |
gh release create ${{ steps.semver.outputs.nextStrict }} \ | |
--repo="$GITHUB_REPOSITORY" \ | |
--title="${GITHUB_REPOSITORY#*/} ${{ steps.semver.outputs.nextStrict }}" \ | |
--generate-notes |