chore: release 2.3.1 #270
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
| --- | |
| # yaml-language-server: $schema=https://www.schemastore.org/github-workflow.json | |
| name: binaries | |
| "on": | |
| workflow_dispatch: | |
| pull_request: | |
| branches: | |
| - master | |
| push: | |
| branches: | |
| - master | |
| tags: | |
| - v* | |
| permissions: | |
| contents: write | |
| jobs: | |
| binaries: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Generate token | |
| id: token | |
| uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2 | |
| with: | |
| app-id: ${{ secrets.TOKEN_EXCHANGE_APP }} | |
| private-key: ${{ secrets.TOKEN_EXCHANGE_KEY }} | |
| permission-contents: write | |
| permission-packages: write | |
| - name: Checkout source | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 | |
| - name: Configure aws | |
| uses: aws-actions/configure-aws-credentials@61815dcd50bd041e203e49132bacad1fd04d2708 # v5 | |
| with: | |
| aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| aws-region: eu-central-1 | |
| - name: Setup golang | |
| uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6 | |
| with: | |
| go-version-file: go.mod | |
| - name: Setup task | |
| uses: arduino/setup-task@v2 | |
| with: | |
| version: 3.x | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Setup goreleaser | |
| uses: goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a # v6 | |
| with: | |
| install-only: true | |
| - name: Setup signing | |
| if: github.event_name != 'pull_request' | |
| uses: crazy-max/ghaction-import-gpg@e89d40939c28e39f97cf32126055eeae86ba74ec # v6 | |
| with: | |
| gpg_private_key: ${{ secrets.GNUPG_KEY }} | |
| passphrase: ${{ secrets.GNUPG_PASSWORD }} | |
| - name: Run release | |
| env: | |
| GITHUB_TOKEN: ${{ steps.token.outputs.token }} | |
| run: | | |
| if [[ $GITHUB_REF == refs/tags/* ]]; then | |
| task build:release | |
| else | |
| task build:snapshot | |
| fi | |
| - name: Upload version | |
| if: startsWith(github.ref, 'refs/tags/') | |
| run: | | |
| aws s3 sync --exclude "*" --include "errors-*" dist s3://dl.webhippie.de/errors/${{ github.ref_name }}/ | |
| - name: Upload testing | |
| if: startsWith(github.ref, 'refs/heads/') | |
| run: | | |
| aws s3 sync --exclude "*" --include "errors-*" dist s3://dl.webhippie.de/errors/testing/ | |
| - name: Install cloudsmith | |
| if: startsWith(github.ref, 'refs/tags/') | |
| uses: cloudsmith-io/cloudsmith-cli-action@7de77876f92caf8db21887182d83d086fc8f31f3 # v2.0.0 | |
| with: | |
| api-key: ${{ secrets.CLOUDSMITH_API_KEY }} | |
| - name: Upload packages | |
| if: startsWith(github.ref, 'refs/tags/') | |
| run: | | |
| for PACKAGE in dist/errors-*.deb; do | |
| cloudsmith push deb webhippie/general/any-distro/any-version "${PACKAGE}" | |
| done | |
| for PACKAGE in dist/errors-*.rpm; do | |
| cloudsmith push rpm webhippie/general/any-distro/any-version "${PACKAGE}" | |
| done | |
| ... |