2022-09-19 02:31:33 +02:00
|
|
|
name: release
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- 'main'
|
|
|
|
tags:
|
|
|
|
- 'v*'
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
id-token: write
|
|
|
|
packages: write
|
|
|
|
|
|
|
|
jobs:
|
2022-12-29 19:55:45 +02:00
|
|
|
trigger-generate:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: [ goreleaser ]
|
|
|
|
steps:
|
2022-12-30 14:13:12 +02:00
|
|
|
- uses: benc-uk/workflow-dispatch@v121
|
2023-01-11 14:40:12 +02:00
|
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
2022-12-29 19:55:45 +02:00
|
|
|
with:
|
|
|
|
repo: goreleaser/goreleaser
|
|
|
|
ref: main
|
|
|
|
token: ${{ secrets.GH_PAT }}
|
2022-12-29 20:02:27 +02:00
|
|
|
workflow: generate-releases.yml
|
2023-01-09 19:45:29 +02:00
|
|
|
notify-goreleaser-cross:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: [ trigger-generate ]
|
|
|
|
steps:
|
|
|
|
- name: get version
|
|
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
|
|
run: echo "RELEASE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
|
|
|
|
- name: notify goreleaser-cross with new release
|
|
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
|
|
uses: benc-uk/workflow-dispatch@v121
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.GH_PAT }}
|
|
|
|
repo: goreleaser/goreleaser-cross
|
|
|
|
workflow: goreleaser-bump
|
|
|
|
inputs: '{ "tag" : "${{ env.RELEASE_TAG }}" }'
|
2022-09-19 02:31:33 +02:00
|
|
|
goreleaser-check-pkgs:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
DOCKER_CLI_EXPERIMENTAL: "enabled"
|
2022-12-29 19:55:45 +02:00
|
|
|
needs: [ goreleaser ]
|
2022-09-19 02:31:33 +02:00
|
|
|
if: github.ref == 'refs/heads/main'
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
format: [ deb, rpm, apk ]
|
|
|
|
steps:
|
2023-08-26 20:31:13 +02:00
|
|
|
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
|
2022-09-19 02:31:33 +02:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2023-02-01 14:19:19 +02:00
|
|
|
- uses: arduino/setup-task@e26d8975574116b0097a1161e0fe16ba75d84c1c # v1
|
2022-09-19 02:31:33 +02:00
|
|
|
with:
|
|
|
|
version: 3.x
|
|
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
2023-06-08 14:10:29 +02:00
|
|
|
- uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v2
|
2023-03-13 14:25:53 +02:00
|
|
|
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3
|
2022-09-19 02:31:33 +02:00
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
./dist/*.deb
|
|
|
|
./dist/*.rpm
|
|
|
|
./dist/*.apk
|
|
|
|
key: ${{ github.ref }}
|
|
|
|
- run: task goreleaser:test:${{ matrix.format }}
|
|
|
|
goreleaser:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
DOCKER_CLI_EXPERIMENTAL: "enabled"
|
|
|
|
steps:
|
2023-08-26 20:31:13 +02:00
|
|
|
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
|
2022-09-19 02:31:33 +02:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2023-02-01 14:19:19 +02:00
|
|
|
- uses: arduino/setup-task@e26d8975574116b0097a1161e0fe16ba75d84c1c # v1
|
2022-09-19 02:31:33 +02:00
|
|
|
with:
|
|
|
|
version: 3.x
|
|
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
2023-06-08 14:10:29 +02:00
|
|
|
- uses: docker/setup-qemu-action@2b82ce82d56a2a04d2637cd93a637ae1b359c0a7 # v2
|
2023-08-28 14:05:38 +02:00
|
|
|
- uses: docker/setup-buildx-action@885d1462b80bc1c1c7f0b00334ad271f09369c55 # v2
|
2022-09-19 02:31:33 +02:00
|
|
|
- name: setup-snapcraft
|
|
|
|
# FIXME: the mkdirs are a hack for https://github.com/goreleaser/goreleaser/issues/1715
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get -yq --no-install-suggests --no-install-recommends install snapcraft
|
|
|
|
mkdir -p $HOME/.cache/snapcraft/download
|
|
|
|
mkdir -p $HOME/.cache/snapcraft/stage-packages
|
2023-08-09 15:14:03 +02:00
|
|
|
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4
|
2022-09-19 02:31:33 +02:00
|
|
|
with:
|
2023-03-17 05:40:25 +02:00
|
|
|
go-version: stable
|
2023-03-13 14:25:53 +02:00
|
|
|
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3
|
2022-09-19 02:31:33 +02:00
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
./dist/*.deb
|
|
|
|
./dist/*.rpm
|
|
|
|
./dist/*.apk
|
|
|
|
key: ${{ github.ref }}
|
2023-09-04 15:32:25 +02:00
|
|
|
- uses: sigstore/cosign-installer@v3.1.2
|
2023-06-21 21:13:11 +02:00
|
|
|
- uses: anchore/sbom-action/download-syft@v0.14.3
|
2023-05-03 19:06:40 +02:00
|
|
|
- uses: crazy-max/ghaction-upx@v2
|
|
|
|
with:
|
|
|
|
install-only: true
|
2023-09-07 20:09:26 +02:00
|
|
|
- uses: cachix/install-nix-action@v23
|
2023-05-26 04:07:10 +02:00
|
|
|
with:
|
|
|
|
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
2022-09-19 02:31:33 +02:00
|
|
|
- name: dockerhub-login
|
|
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
2023-06-08 14:41:57 +02:00
|
|
|
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2
|
2022-09-19 02:31:33 +02:00
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKER_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
|
|
- name: ghcr-login
|
|
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
2023-06-08 14:41:57 +02:00
|
|
|
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2
|
2022-09-19 02:31:33 +02:00
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
|
|
|
username: ${{ github.repository_owner }}
|
|
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: snapcraft-login
|
2022-09-28 02:20:57 +02:00
|
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
2022-09-19 02:31:33 +02:00
|
|
|
run: snapcraft login --with <(echo "${{ secrets.SNAPCRAFT_LOGIN }}")
|
|
|
|
- name: goreleaser-release
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
|
|
|
|
TWITTER_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }}
|
|
|
|
TWITTER_CONSUMER_SECRET: ${{ secrets.TWITTER_CONSUMER_SECRET }}
|
|
|
|
TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }}
|
|
|
|
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
|
2022-11-18 02:42:43 +02:00
|
|
|
MASTODON_CLIENT_ID: ${{ secrets.MASTODON_CLIENT_ID }}
|
|
|
|
MASTODON_CLIENT_SECRET: ${{ secrets.MASTODON_CLIENT_SECRET }}
|
|
|
|
MASTODON_ACCESS_TOKEN: ${{ secrets.MASTODON_ACCESS_TOKEN }}
|
2022-09-19 02:31:33 +02:00
|
|
|
COSIGN_PWD: ${{ secrets.COSIGN_PWD }}
|
|
|
|
FURY_TOKEN: ${{ secrets.FURY_TOKEN }}
|
|
|
|
DISCORD_WEBHOOK_ID: ${{ secrets.DISCORD_WEBHOOK_ID }}
|
|
|
|
DISCORD_WEBHOOK_TOKEN: ${{ secrets.DISCORD_WEBHOOK_TOKEN }}
|
|
|
|
AUR_KEY: ${{ secrets.AUR_KEY }}
|
|
|
|
run: task goreleaser
|