release #22
This file contains hidden or 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: | |
| inputs: | |
| snapshot: | |
| description: 'Use snapshot version?' | |
| required: true | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: ${{ github.repository }} | |
| jobs: | |
| build-and-release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| packages: write | |
| defaults: | |
| run: | |
| working-directory: . | |
| steps: | |
| - uses: actions/checkout@v2 | |
| - name: Setup JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: zulu | |
| java-version: 17 | |
| cache: gradle | |
| - name: Setup Gradle 8.1.1 | |
| uses: gradle/actions/setup-gradle@v4 | |
| with: | |
| gradle-version: '8.1.1' | |
| - name: Set up QEMU for cross-platform builds | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx for cross-platform builds | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to the Container registry | |
| uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build, tag, and push image | |
| env: | |
| FULL_IMAGE_NAME: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | |
| run: | | |
| version=$(gradle properties --no-daemon --console=plain -q | grep "^version:" | awk '{printf $2}') | |
| if [ "${{ github.event.inputs.snapshot }}" != "true" ]; then | |
| version="${version//-SNAPSHOT/}" | |
| fi | |
| echo "Using version: $version" | |
| echo "heimdall_version=$version" >> "$GITHUB_ENV" | |
| gradle build -i -Pversion=$version -Dquarkus.container-image.build=true -Dquarkus.container-image.image=$FULL_IMAGE_NAME:$version -Dquarkus.container-image.push=true | |
| - name: Git tag | |
| uses: rickstaa/action-create-tag@v1 | |
| if: "!contains(env.heimdall_version, 'SNAPSHOT')" | |
| with: | |
| tag: "${{ env.heimdall_version }}" | |
| tag_exists_error: false |