chore: update go dependencies #1165
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: | |
| push: | |
| branches: [main, release/*, release] | |
| pull_request: | |
| jobs: | |
| prepare: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| web: ${{ steps.web.outputs.any_changed }} | |
| server: ${{ steps.server.outputs.any_changed }} | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@fe104658747b27e96e4f7e80cd0a94068e53901d # v2.16.1 | |
| with: | |
| egress-policy: audit | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| fetch-depth: 0 | |
| - name: changed files for web | |
| id: web | |
| uses: step-security/changed-files@3dbe17c78367e7d60f00d78ae6781a35be47b4a1 # v45.0.1 | |
| with: | |
| files: | | |
| web/ | |
| .github/workflows/ci.yml | |
| .github/workflows/ci_web.yml | |
| .github/workflows/build_web.yml | |
| .github/workflows/deploy_web_nightly.yml | |
| CHANGELOG.md | |
| - name: changed files for server | |
| id: server | |
| uses: step-security/changed-files@3dbe17c78367e7d60f00d78ae6781a35be47b4a1 # v45.0.1 | |
| with: | |
| files: | | |
| server/ | |
| .github/workflows/ci.yml | |
| .github/workflows/ci_server.yml | |
| .github/workflows/build_server.yml | |
| .github/workflows/deploy_server_nightly.yml | |
| server/.goreleaser.yml | |
| CHANGELOG.md | |
| ci-web: | |
| needs: prepare | |
| if: needs.prepare.outputs.web == 'true' | |
| uses: ./.github/workflows/ci_web.yml | |
| ci-server: | |
| needs: prepare | |
| if: needs.prepare.outputs.server == 'true' | |
| uses: ./.github/workflows/ci_server.yml | |
| ci: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - ci-web | |
| - ci-server | |
| if: '!failure()' | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@fe104658747b27e96e4f7e80cd0a94068e53901d # v2.16.1 | |
| with: | |
| egress-policy: audit | |
| - run: echo OK | |
| ci-collect-info: | |
| name: Collect information | |
| needs: ci | |
| if: '!failure()' | |
| runs-on: ubuntu-latest | |
| outputs: | |
| sha_short: ${{ steps.info.outputs.sha_short || 'blank' }} | |
| new_tag: ${{ steps.info.outputs.new_tag || 'blank' }} | |
| new_tag_short: ${{ steps.info.outputs.new_tag_short || 'blank' }} | |
| name: ${{ steps.info.outputs.name || 'blank' }} | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@fe104658747b27e96e4f7e80cd0a94068e53901d # v2.16.1 | |
| with: | |
| egress-policy: audit | |
| - name: checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Fetch tags | |
| run: git fetch --prune --unshallow --tags | |
| - name: Get info | |
| id: info | |
| # The tag name should be retrieved lazily, as tagging may be delayed. | |
| env: | |
| BRANCH: ${{github.ref_name}} | |
| run: | | |
| echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" | |
| echo "BRANCH=$BRANCH" | |
| if [[ "$BRANCH" = "release" || "$BRANCH" = "release/"* ]]; then | |
| TAG=$(git tag --points-at HEAD) | |
| if [[ ! -z "$TAG" ]]; then | |
| echo "::set-output name=new_tag::$TAG" | |
| echo "::set-output name=new_tag_short::${TAG#v}" | |
| else | |
| echo "::set-output name=name::rc" | |
| fi | |
| else | |
| echo "::set-output name=name::nightly" | |
| fi | |
| - name: Show info | |
| env: | |
| SHA_SHORT: ${{ steps.info.outputs.sha_short }} | |
| NEW_TAG: ${{ steps.info.outputs.new_tag }} | |
| NEW_TAG_SHORT: ${{ steps.info.outputs.new_tag_short }} | |
| NAME: ${{ steps.info.outputs.name }} | |
| run: echo "sha_short=$SHA_SHORT, new_tag=$NEW_TAG, new_tag_short=$NEW_TAG_SHORT, name=$NAME" | |
| build-web: | |
| needs: | |
| - ci | |
| - ci-web | |
| - ci-collect-info | |
| runs-on: ubuntu-latest | |
| permissions: | |
| actions: write | |
| if: ${{!failure() && needs.ci-web.result == 'success' && github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'release' || startsWith(github.ref_name, 'release/'))}} | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@fe104658747b27e96e4f7e80cd0a94068e53901d # v2.16.1 | |
| with: | |
| egress-policy: audit | |
| - name: Dispatch Web Build | |
| uses: benc-uk/workflow-dispatch@e2e5e9a103e331dad343f381a29e654aea3cf8fc # v1.2.4 | |
| with: | |
| workflow: build_web.yml | |
| inputs: '{ | |
| "sha_short": "${{ needs.ci-collect-info.outputs.sha_short }}", | |
| "new_tag": "${{ needs.ci-collect-info.outputs.new_tag }}", | |
| "new_tag_short": "${{ needs.ci-collect-info.outputs.new_tag_short }}", | |
| "name": "${{ needs.ci-collect-info.outputs.name }}", | |
| "sha": "${{ github.sha }}" | |
| }' | |
| build-server: | |
| needs: | |
| - ci | |
| - ci-server | |
| - ci-collect-info | |
| runs-on: ubuntu-latest | |
| permissions: | |
| actions: write | |
| if: ${{!failure() && needs.ci-server.result == 'success' && github.event_name == 'push' && (github.ref_name == 'main' || github.ref_name == 'release' || startsWith(github.ref_name, 'release/'))}} | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@fe104658747b27e96e4f7e80cd0a94068e53901d # v2.16.1 | |
| with: | |
| egress-policy: audit | |
| - name: Dispatch Server Build | |
| uses: benc-uk/workflow-dispatch@e2e5e9a103e331dad343f381a29e654aea3cf8fc # v1.2.4 | |
| with: | |
| workflow: build_server.yml | |
| inputs: '{ | |
| "sha_short": "${{ needs.ci-collect-info.outputs.sha_short }}", | |
| "new_tag": "${{ needs.ci-collect-info.outputs.new_tag }}", | |
| "new_tag_short": "${{ needs.ci-collect-info.outputs.new_tag_short }}", | |
| "name": "${{ needs.ci-collect-info.outputs.name }}", | |
| "sha": "${{ github.sha }}" | |
| }' |