[deps] updgrade #1
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: PR | |
| on: | |
| pull_request: | |
| branches: [master] | |
| concurrency: | |
| group: pr-${{ github.event.pull_request.number }} | |
| cancel-in-progress: true | |
| jobs: | |
| goreleaser: | |
| runs-on: ubuntu-latest | |
| env: | |
| DOCKER_REGISTRY: ${{ vars.DOCKER_REGISTRY || format('ghcr.io/{0}', github.repository_owner) }} | |
| DOCKER_REGISTRY_HOST: ${{ vars.DOCKER_REGISTRY_HOST || 'ghcr.io' }} | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| packages: write | |
| steps: | |
| - name: Prepare | |
| run: | | |
| repository=${{ github.repository }} | |
| echo "PROJECT_NAME=${repository#*/}" >> $GITHUB_ENV | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Login to Container registry | |
| if: github.actor != 'dependabot[bot]' | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.DOCKER_REGISTRY_HOST }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version: stable | |
| - name: Run GoReleaser | |
| uses: goreleaser/goreleaser-action@v6 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| DOCKER_REGISTRY: ${{ env.DOCKER_REGISTRY }} | |
| with: | |
| distribution: goreleaser | |
| version: "~> v2" | |
| args: release --snapshot | |
| - name: Upload to S3 | |
| if: github.actor != 'dependabot[bot]' | |
| uses: capcom6/upload-s3-action@c4fae9e0868ea2a99ef8e9318e93821e84086955 # v2.0.0 | |
| env: | |
| AWS_REGION: ${{ secrets.AWS_REGION }} | |
| with: | |
| aws_key_id: ${{ secrets.AWS_KEY_ID }} | |
| aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}} | |
| aws_bucket: ${{ secrets.AWS_BUCKET }} | |
| endpoint: ${{ secrets.AWS_ENDPOINT }} | |
| source_files: | | |
| dist/${{ env.PROJECT_NAME }}_*.zip | |
| dist/${{ env.PROJECT_NAME }}_*.tar.gz | |
| destination_dir: ${{ github.repository }}/${{ github.event.pull_request.head.sha }} | |
| - name: Push images | |
| if: github.actor != 'dependabot[bot]' | |
| env: | |
| DOCKER_REGISTRY: ${{ env.DOCKER_REGISTRY }} | |
| PROJECT_NAME: ${{ env.PROJECT_NAME }} | |
| run: | | |
| docker tag ${{ env.DOCKER_REGISTRY }}/${{ env.PROJECT_NAME }}:latest-arm64 ${{ env.DOCKER_REGISTRY }}/${{ env.PROJECT_NAME }}:pr-${{ github.event.pull_request.number }}-arm64 | |
| docker tag ${{ env.DOCKER_REGISTRY }}/${{ env.PROJECT_NAME }}:latest-amd64 ${{ env.DOCKER_REGISTRY }}/${{ env.PROJECT_NAME }}:pr-${{ github.event.pull_request.number }}-amd64 | |
| docker push ${{ env.DOCKER_REGISTRY }}/${{ env.PROJECT_NAME }}:pr-${{ github.event.pull_request.number }}-arm64 | |
| docker push ${{ env.DOCKER_REGISTRY }}/${{ env.PROJECT_NAME }}:pr-${{ github.event.pull_request.number }}-amd64 | |
| docker manifest create ${{ env.DOCKER_REGISTRY }}/${{ env.PROJECT_NAME }}:pr-${{ github.event.pull_request.number }} \ | |
| ${{ env.DOCKER_REGISTRY }}/${{ env.PROJECT_NAME }}:pr-${{ github.event.pull_request.number }}-amd64 \ | |
| ${{ env.DOCKER_REGISTRY }}/${{ env.PROJECT_NAME }}:pr-${{ github.event.pull_request.number }}-arm64 | |
| docker manifest push ${{ env.DOCKER_REGISTRY }}/${{ env.PROJECT_NAME }}:pr-${{ github.event.pull_request.number }} | |
| - name: Find Comment | |
| if: github.actor != 'dependabot[bot]' | |
| uses: peter-evans/find-comment@v3 | |
| id: fc | |
| with: | |
| issue-number: ${{ github.event.pull_request.number }} | |
| comment-author: "github-actions[bot]" | |
| body-includes: Pull request artifacts | |
| - name: Create or update comment | |
| if: github.actor != 'dependabot[bot]' | |
| uses: peter-evans/create-or-update-comment@v4 | |
| env: | |
| DOCKER_REGISTRY: ${{ env.DOCKER_REGISTRY }} | |
| PROJECT_NAME: ${{ env.PROJECT_NAME }} | |
| with: | |
| comment-id: ${{ steps.fc.outputs.comment-id }} | |
| issue-number: ${{ github.event.pull_request.number }} | |
| body: | | |
| ## 🤖 Pull request artifacts | |
| | Platform | File | | |
| | ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | |
| | 🐳 Docker | [GitHub Container Registry](https://${{ env.DOCKER_REGISTRY }}/${{ env.PROJECT_NAME }}:pr-${{ github.event.pull_request.number }}) | | |
| | 🍎 Darwin arm64 | [${{ env.PROJECT_NAME }}_Darwin_arm64.tar.gz](https://${{ secrets.AWS_BUCKET }}/${{ github.repository }}/${{ github.event.pull_request.head.sha }}/${{ env.PROJECT_NAME }}_Darwin_arm64.tar.gz) | | |
| | 🍎 Darwin x86_64 | [${{ env.PROJECT_NAME }}_Darwin_x86_64.tar.gz](https://${{ secrets.AWS_BUCKET }}/${{ github.repository }}/${{ github.event.pull_request.head.sha }}/${{ env.PROJECT_NAME }}_Darwin_x86_64.tar.gz) | | |
| | 🐧 Linux arm64 | [${{ env.PROJECT_NAME }}_Linux_arm64.tar.gz](https://${{ secrets.AWS_BUCKET }}/${{ github.repository }}/${{ github.event.pull_request.head.sha }}/${{ env.PROJECT_NAME }}_Linux_arm64.tar.gz) | | |
| | 🐧 Linux i386 | [${{ env.PROJECT_NAME }}_Linux_i386.tar.gz](https://${{ secrets.AWS_BUCKET }}/${{ github.repository }}/${{ github.event.pull_request.head.sha }}/${{ env.PROJECT_NAME }}_Linux_i386.tar.gz) | | |
| | 🐧 Linux x86_64 | [${{ env.PROJECT_NAME }}_Linux_x86_64.tar.gz](https://${{ secrets.AWS_BUCKET }}/${{ github.repository }}/${{ github.event.pull_request.head.sha }}/${{ env.PROJECT_NAME }}_Linux_x86_64.tar.gz) | | |
| | 🪟 Windows arm64 | [${{ env.PROJECT_NAME }}_Windows_arm64.zip](https://${{ secrets.AWS_BUCKET }}/${{ github.repository }}/${{ github.event.pull_request.head.sha }}/${{ env.PROJECT_NAME }}_Windows_arm64.zip) | | |
| | 🪟 Windows i386 | [${{ env.PROJECT_NAME }}_Windows_i386.zip](https://${{ secrets.AWS_BUCKET }}/${{ github.repository }}/${{ github.event.pull_request.head.sha }}/${{ env.PROJECT_NAME }}_Windows_i386.zip) | | |
| | 🪟 Windows x86_64 | [${{ env.PROJECT_NAME }}_Windows_x86_64.zip](https://${{ secrets.AWS_BUCKET }}/${{ github.repository }}/${{ github.event.pull_request.head.sha }}/${{ env.PROJECT_NAME }}_Windows_x86_64.zip) | | |
| edit-mode: replace |