Release #17
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: Release | |
on: | |
workflow_dispatch: | |
jobs: | |
prepare-release: | |
runs-on: ubuntu-latest | |
outputs: | |
NEXT_RELEASE: ${{ env.NEXT_RELEASE }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.GH_TOKEN }} | |
- name: Set up JDK 17 | |
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 "actions@github.com" | |
git config user.name "GitHub Actions" | |
- name: Install dependencies needed | |
run: $GITHUB_WORKSPACE/install_dependencies.sh | |
- 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 }} | |
- name: Set up JDK 17 | |
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 "actions@github.com" | |
git config user.name "GitHub Actions" | |
- name: Install dependencies needed | |
run: $GITHUB_WORKSPACE/install_dependencies.sh | |
- 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/release-action@v1.14.0 | |
with: | |
artifacts: "tntconcept-web/target/*.war" | |
tag: ${{ env.NEXT_RELEASE }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |