Skip to content

Release

Release #49

Workflow file for this run

name: Release
on:
workflow_dispatch:
jobs:
prepare-release:
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
NEXT_RELEASE: ${{ env.NEXT_RELEASE }}
steps:
- uses: actions/checkout@v4
# with:
# token: ${{ secrets.GH_TOKEN }}
- uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "temurin"
cache: "maven"
server-id: "github"
- name: Configure Git user
run: |
git config user.email "[email protected]"
git config user.name "GitHub Actions"
- name: Prepare Maven release
run: |
./mvnw --batch-mode release:prepare
NEXT_RELEASE=$(grep -r 'scm.tag=' release.properties | sed 's/scm.tag=//')
echo "NEXT_RELEASE=$NEXT_RELEASE" >> $GITHUB_ENV
upload-artifacts:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
needs: [ prepare-release ]
env:
NEXT_RELEASE: ${{ needs.prepare-release.outputs.NEXT_RELEASE }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ env.NEXT_RELEASE }}
- uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "temurin"
cache: "maven"
server-id: "github"
- name: Configure Git user
run: |
git config user.email "[email protected]"
git config user.name "GitHub Actions"
- name: Build and deploy on maven repository
run: ./mvnw --batch-mode clean deploy
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Docker release
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
./mvnw --batch-mode clean install jib:build -Ddocker.tag=${{ env.NEXT_RELEASE }}
docker logout ghcr.io
- name: Create GitHub release
uses: ncipollo/[email protected]
with:
tag: ${{ env.NEXT_RELEASE }}
token: ${{ secrets.GITHUB_TOKEN }}