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:
|
|
|
|
goreleaser-check-pkgs:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
DOCKER_CLI_EXPERIMENTAL: "enabled"
|
|
|
|
needs:
|
|
|
|
- goreleaser
|
|
|
|
if: github.ref == 'refs/heads/main'
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
format: [ deb, rpm, apk ]
|
|
|
|
steps:
|
2022-10-05 14:38:34 +02:00
|
|
|
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3
|
2022-09-19 02:31:33 +02:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2022-10-13 00:04:36 +02:00
|
|
|
- uses: arduino/setup-task@d665c6beebae46ff3f699d7b2fd3f1959de7153c # v1
|
2022-09-19 02:31:33 +02:00
|
|
|
with:
|
|
|
|
version: 3.x
|
|
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
2022-10-13 15:52:43 +02:00
|
|
|
- uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2
|
2022-10-04 14:24:28 +02:00
|
|
|
- uses: actions/cache@56461b9eb0f8438fd15c7a9968e3c9ebb18ceff1 # 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:
|
2022-10-05 14:38:34 +02:00
|
|
|
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3
|
2022-09-19 02:31:33 +02:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2022-10-13 00:04:36 +02:00
|
|
|
- uses: arduino/setup-task@d665c6beebae46ff3f699d7b2fd3f1959de7153c # v1
|
2022-09-19 02:31:33 +02:00
|
|
|
with:
|
|
|
|
version: 3.x
|
|
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
2022-10-13 15:52:43 +02:00
|
|
|
- uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 # v2
|
2022-10-13 15:51:29 +02:00
|
|
|
- uses: docker/setup-buildx-action@95cb08cb2672c73d4ffd2f422e6d11953d2a9c70 # 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
|
|
|
|
- uses: actions/setup-go@268d8c0ca0432bb2cf416faae41297df9d262d7f # v3
|
|
|
|
with:
|
2022-10-06 02:24:45 +02:00
|
|
|
go-version: '>=1.19.2'
|
2022-09-19 02:31:33 +02:00
|
|
|
cache: true
|
2022-10-04 14:24:28 +02:00
|
|
|
- uses: actions/cache@56461b9eb0f8438fd15c7a9968e3c9ebb18ceff1 # v3
|
2022-09-19 02:31:33 +02:00
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
./dist/*.deb
|
|
|
|
./dist/*.rpm
|
|
|
|
./dist/*.apk
|
|
|
|
key: ${{ github.ref }}
|
2022-10-10 19:50:18 +02:00
|
|
|
- uses: sigstore/cosign-installer@v2.8.0
|
2022-09-19 02:31:33 +02:00
|
|
|
- uses: anchore/sbom-action/download-syft@v0.12.0
|
|
|
|
- name: dockerhub-login
|
|
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
2022-10-13 00:05:18 +02:00
|
|
|
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v1
|
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')
|
2022-10-13 00:05:18 +02:00
|
|
|
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v1
|
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 }}
|
|
|
|
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
|