Pin dependencies #4719
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: CI | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| defaults: | |
| run: | |
| shell: bash | |
| permissions: | |
| contents: read | |
| jobs: | |
| binary: | |
| name: Build Binary | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Golang Environment | |
| uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0 | |
| with: | |
| go-version: stable | |
| - name: Build binary | |
| uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0 | |
| with: | |
| version: v2.13.2 # renovate: datasource=github-tags depName=goreleaser/goreleaser | |
| args: build --snapshot --clean --single-target | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| unit-tests: | |
| name: Unit Tests | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - name: Setup Golang Environment | |
| uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0 | |
| with: | |
| go-version: stable | |
| - name: Run Tests | |
| run: make test | |
| build: | |
| name: Build Packages | |
| runs-on: ubuntu-24.04 | |
| needs: [binary, unit-tests] | |
| permissions: | |
| contents: write | |
| id-token: write | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Golang Environment | |
| uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0 | |
| with: | |
| go-version: stable | |
| - name: Draft Release Notes | |
| uses: lucacome/draft-release@0ebb400b90474a1b791602046abf8394e9f5402d # v2.0.2 | |
| with: | |
| minor-label: "enhancement" | |
| major-label: "change" | |
| publish: ${{ github.ref_type == 'tag' }} | |
| collapse-after: 50 | |
| notes-footer: | | |
| ## Resources | |
| - Documentation -- https://github.com/nginx/nginx-asg-sync/blob/{{version}}/README.md | |
| if: github.event_name != 'pull_request' | |
| - name: Download Syft | |
| uses: anchore/sbom-action/download-syft@a930d0ac434e3182448fe678398ba5713717112a # v0.21.0 | |
| if: github.ref_type == 'tag' | |
| - name: Install Cosign | |
| uses: sigstore/cosign-installer@faadad0cce49287aee09b3a48701e75088a2c6ad # v4.0.0 | |
| if: github.ref_type == 'tag' | |
| - name: Setup Snapcraft | |
| run: | | |
| sudo snap install snapcraft --classic | |
| mkdir -p $HOME/.cache/snapcraft/download | |
| mkdir -p $HOME/.cache/snapcraft/stage-packages | |
| if: github.ref_type == 'tag' | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3 | |
| with: | |
| platforms: arm64 | |
| if: github.ref_type == 'tag' | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3 | |
| with: | |
| #version: v0.12.1 | |
| #version: https://github.com/docker/buildx.git#master | |
| driver-opts: network=host | |
| if: github.ref_type == 'tag' | |
| - name: Get Id Token | |
| uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 | |
| id: idtoken1 | |
| with: | |
| script: | | |
| let id_token = await core.getIDToken() | |
| core.setOutput('id_token', id_token) | |
| if: github.ref_type == 'tag' | |
| - name: Login to NGINX Registry | |
| uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3 | |
| with: | |
| registry: docker-mgmt-test.nginx.com | |
| username: ${{ steps.idtoken1.outputs.id_token }} | |
| password: ${{ github.actor }} | |
| if: github.ref_type == 'tag' | |
| - name: Run GoReleaser | |
| uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6.4.0 | |
| with: | |
| version: v2.13.2 # renovate: datasource=github-tags depName=goreleaser/goreleaser | |
| args: ${{ github.ref_type == 'tag' && 'release' || 'build --snapshot' }} --clean | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NGINX_GITHUB_TOKEN: ${{ secrets.NGINX_PAT }} |