chore(deps): bump actions/attest-build-provenance to 3.1.0 (#4907) #715
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: | |
| push: | |
| tags: | |
| - v*.*.* | |
| branches: | |
| - main | |
| permissions: | |
| attestations: write | |
| contents: write | |
| id-token: write # required for OIDC and provenance (npm publish) | |
| pull-requests: read | |
| jobs: | |
| release: | |
| runs-on: ubuntu-24.04 | |
| env: | |
| DOCKER_IMAGE_NAME: docker.elastic.co/observability/apm-agent-nodejs | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| # Require npm 11.5.1 or later for https://docs.npmjs.com/trusted-publishers. | |
| node-version: 'v24.8.0' | |
| # Setup a Docker "buildx" builder container, used by "build-push-action" | |
| # below for multi-platform image builds. Notes on multi-platform images: | |
| # https://github.com/elastic/apm-agent-nodejs/issues/4038#issuecomment-2130406402 | |
| - uses: docker/setup-buildx-action@v3 | |
| - name: Log in to the Elastic Container registry | |
| uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0 | |
| with: | |
| registry: ${{ secrets.ELASTIC_DOCKER_REGISTRY }} | |
| username: ${{ secrets.ELASTIC_DOCKER_USERNAME }} | |
| password: ${{ secrets.ELASTIC_DOCKER_PASSWORD }} | |
| - run: make -C .ci env | |
| - run: make -C .ci dist | |
| - name: Attest Lambda layer zip | |
| uses: actions/attest-build-provenance@00014ed6ed5efc5b1ab7f7f34a39eb55d41aa4f8 # v3.1.0 | |
| with: | |
| subject-path: "${{ github.workspace }}/build/aws/elastic-apm-node-lambda-layer-*.zip" | |
| - name: Extract metadata (tags, labels) | |
| id: docker-meta | |
| uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.0 | |
| with: | |
| images: ${{ env.DOCKER_IMAGE_NAME }} | |
| flavor: | | |
| latest=auto | |
| tags: | | |
| # "1.2.3" and "latest" Docker tags on push of git tag "v1.2.3" | |
| type=semver,pattern={{version}} | |
| # "edge" Docker tag on git push to default branch | |
| type=edge | |
| - name: Build and Push Docker Image | |
| id: docker-push | |
| uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 | |
| with: | |
| context: . | |
| platforms: linux/amd64,linux/arm64 | |
| file: 'Dockerfile' | |
| push: true | |
| tags: ${{ steps.docker-meta.outputs.tags }} | |
| labels: ${{ steps.docker-meta.outputs.labels }} | |
| build-args: | | |
| AGENT_DIR=/build/dist/nodejs | |
| - name: Attest Docker image | |
| uses: actions/attest-build-provenance@00014ed6ed5efc5b1ab7f7f34a39eb55d41aa4f8 # v3.1.0 | |
| with: | |
| subject-name: "${{ env.DOCKER_IMAGE_NAME }}" | |
| subject-digest: ${{ steps.docker-push.outputs.digest }} | |
| push-to-registry: true | |
| - name: Extract metadata (tags, labels) (wolfi) | |
| id: docker-meta-wolfi | |
| uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.0 | |
| with: | |
| images: ${{ env.DOCKER_IMAGE_NAME }} | |
| flavor: | | |
| latest=auto | |
| suffix=-wolfi | |
| tags: | | |
| # "1.2.3" and "latest" Docker tags on push of git tag "v1.2.3" | |
| type=semver,pattern={{version}} | |
| # "edge" Docker tag on git push to default branch | |
| type=edge | |
| - name: Build and Push Docker Image (wolfi) | |
| id: docker-push-wolfi | |
| uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 | |
| with: | |
| context: . | |
| platforms: linux/amd64,linux/arm64 | |
| file: 'Dockerfile.wolfi' | |
| push: true | |
| tags: ${{ steps.docker-meta-wolfi.outputs.tags }} | |
| labels: ${{ steps.docker-meta-wolfi.outputs.labels }} | |
| build-args: | | |
| AGENT_DIR=/build/dist/nodejs | |
| - name: Attest Docker image (wolfi) | |
| uses: actions/attest-build-provenance@00014ed6ed5efc5b1ab7f7f34a39eb55d41aa4f8 # v3.1.0 | |
| with: | |
| subject-name: "${{ env.DOCKER_IMAGE_NAME }}" | |
| subject-digest: ${{ steps.docker-push-wolfi.outputs.digest }} | |
| push-to-registry: true | |
| - uses: elastic/oblt-actions/aws/auth@v1 | |
| with: | |
| aws-account-id: "267093732750" | |
| - name: Publish AWS lambda (only for tag release) | |
| if: startsWith(github.ref, 'refs/tags') | |
| run: make -C .ci publish-in-all-aws-regions create-arn-file | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| - name: create github release (only for tag release) | |
| run: make -C .ci github-release | |
| if: startsWith(github.ref, 'refs/tags') | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| - name: npm publish (only for tag release) | |
| if: startsWith(github.ref, 'refs/tags') | |
| # https://docs.npmjs.com/trusted-publishers | |
| run: npm publish | |
| - if: ${{ always() && startsWith(github.ref, 'refs/tags') }} | |
| uses: elastic/oblt-actions/slack/notify-result@v1 | |
| with: | |
| bot-token: ${{ secrets.SLACK_BOT_TOKEN }} | |
| channel-id: "#apm-agent-node" | |
| message: '[${{ github.repository }}] Release *${{ github.ref_name }}*' |