-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (61 loc) · 1.71 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: release
on:
push:
tags:
- "v*"
jobs:
build:
strategy:
fail-fast: true
matrix:
include:
- { runner: macos-latest, filter: darwin }
- { runner: ubuntu-latest, filter: linux }
name: ${{ matrix.filter }}
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/nix-setup
with:
token: ${{ secrets.GITHUB_TOKEN }}
# https://github.com/actions/cache/blob/main/examples.md#rust---cargo
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
out/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Build ${{ matrix.filter }} targets
run: mask build --filter ${{ matrix.filter }}
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.filter }}
path: out/bin/*
release:
permissions:
contents: write
id-token: write # used by cosign keyless signing
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
# required for goreleaser
fetch-depth: 0
- uses: ./.github/actions/nix-setup
with:
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/download-artifact@v3
with:
path: out/bin/
- name: Release
run: goreleaser release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAP_GITHUB_TOKEN: ${{ secrets.TAP_GITHUB_TOKEN }}