Release: v1.1.0 #26
Workflow file for this run
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: Tagged releases | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| inputs: | |
| dry_run: | |
| description: 'Dry run: validate tag only, skip publish (default true)' | |
| required: false | |
| default: true | |
| type: boolean | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: release-${{ github.ref_name }} | |
| cancel-in-progress: false | |
| jobs: | |
| validate-tag: | |
| name: Validate tag | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Check tag format | |
| env: | |
| TAG: ${{ github.ref_name }} | |
| run: | | |
| set -euo pipefail | |
| echo "$TAG" | grep -qE '^v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-(rc|beta)(0|[1-9][0-9]*))?$' || { | |
| echo "::error::Tag '$TAG' does not match expected format vX.Y.Z[-rcN|-betaN]. Releases must be cut via the 'Release prepare' workflow." | |
| exit 1 | |
| } | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2 | |
| with: | |
| fetch-depth: 1 | |
| persist-credentials: false | |
| - name: Check gradle.properties version matches tag | |
| env: | |
| TAG: ${{ github.ref_name }} | |
| run: | | |
| set -euo pipefail | |
| count=$(grep -cE '^version=' gradle.properties || true) | |
| [[ "$count" == "1" ]] || { echo "::error::expected exactly one 'version=' line in gradle.properties, found $count"; exit 1; } | |
| file_version=$(awk -F= '$1=="version"{print $2}' gradle.properties) | |
| tag_version="${TAG#v}" | |
| [[ "$file_version" == "$tag_version" ]] || { | |
| echo "::error::gradle.properties version '$file_version' does not match tag '$TAG'. Releases must be cut via the 'Release prepare' workflow." | |
| exit 1 | |
| } | |
| release-github: | |
| name: Create GitHub release | |
| needs: [validate-tag] | |
| if: "github.event_name != 'workflow_dispatch' || !inputs.dry_run" | |
| permissions: | |
| contents: write | |
| packages: write | |
| runs-on: ubuntu-24.04 | |
| environment: foss-production | |
| steps: | |
| - name: Checkout source code | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2 | |
| with: | |
| fetch-depth: 0 | |
| persist-credentials: false | |
| - name: Setup project and build environment | |
| uses: ./.github/actions/common-setup | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a #v4.0.0 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd #v4.0.0 | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 #v4.1.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Generate Docker metadata | |
| id: docker-meta | |
| uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf #v6.0.0 | |
| with: | |
| images: ghcr.io/${{ github.repository }} | |
| tags: | | |
| type=semver,pattern={{version}} | |
| labels: | | |
| org.opencontainers.image.title=Octi Server | |
| org.opencontainers.image.description=Synchronization server for Octi | |
| org.opencontainers.image.vendor=d4rken-org | |
| env: | |
| DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 #v7.0.0 | |
| with: | |
| context: . | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: ${{ steps.docker-meta.outputs.tags }} | |
| labels: ${{ steps.docker-meta.outputs.labels }} | |
| annotations: ${{ steps.docker-meta.outputs.annotations }} | |
| - name: Package application | |
| run: ./gradlew installDist | |
| - name: Create ZIP file from the directory | |
| run: zip -r octi-server.zip ./build/install/octi-server | |
| - name: Create GitHub release | |
| uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda #v3.0.0 | |
| with: | |
| prerelease: ${{ contains(github.ref_name, '-beta') || contains(github.ref_name, '-rc') }} | |
| tag_name: ${{ github.ref_name }} | |
| name: ${{ github.ref_name }} | |
| generate_release_notes: true | |
| files: octi-server.zip | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |