Fix event name check for generating attestation #24
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: Build | |
| on: | |
| push: | |
| branches: [ '**' ] | |
| paths-ignore: [ '**.md' ] | |
| workflow_call: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| artifact-metadata: write | |
| attestations: write | |
| id-token: write | |
| packages: write | |
| outputs: | |
| attestation_url: ${{ steps.attest.outputs.attestation-url }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Java | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: zulu | |
| java-version: 17 | |
| cache: gradle | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v5 | |
| - name: Execute Gradle build | |
| env: | |
| GIT_BRANCH: ${{ github.head_ref || github.ref_name }} | |
| run: ./gradlew build | |
| - name: Generate attestation | |
| id: attest | |
| uses: actions/attest@v4 | |
| if: github.event_name == 'release' | |
| with: | |
| subject-name: Lavalink.jar | |
| subject-path: LavalinkServer/build/libs/Lavalink.jar | |
| - name: Upload Artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: Lavalink.jar | |
| path: LavalinkServer/build/libs/Lavalink.jar | |
| archive: false | |
| - name: Docker Meta | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ghcr.io/${{ github.repository }} | |
| tags: | | |
| type=ref,event=branch | |
| type=ref,event=pr | |
| type=semver,pattern={{raw}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| type=semver,pattern={{major}} | |
| type=sha,prefix= | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.repository_owner }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build Ubuntu and Push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| file: LavalinkServer/docker/Dockerfile | |
| context: . | |
| platforms: linux/amd64,linux/arm/v7,linux/arm64/v8 | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} |