-
Notifications
You must be signed in to change notification settings - Fork 0
101 lines (95 loc) · 3.12 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: Release Artifacts
on:
push:
tags:
- "v*.*.*"
env:
BUCKET: ${{ vars.RELEASE_BUCKET }}
RELEASE_REGION: ${{ vars.RELEASE_REGION }}
CHANNEL: ${{ vars.DISTRIBUTION_CHANNEL }}
RELEASES_CLOUDFRONT_ID: ${{ vars.RELEASES_CLOUDFRONT_ID }}
jobs:
checks:
uses: ./.github/workflows/checks.yml
publish:
uses: ./.github/workflows/publish.yml
needs:
- checks
secrets: inherit
homebrew:
uses: ./.github/workflows/homebrew.yml
needs:
- publish
secrets: inherit
release-artifacts:
#if: ${{ false }}
runs-on: ubuntu-latest
needs:
- checks
- publish
- homebrew
steps:
- uses: actions/checkout@v4
- name: Set environment variables
run: |
VERSION=$(cargo pkgid | cut -f2 -d '@')
echo "SEMVER=$VERSION" >> $GITHUB_ENV
- name: Fetch release signing key
run: |
curl -OL https://releases.saveoursecrets.com/signing-key.pub
- name: Install cosign
uses: sigstore/[email protected]
- name: Check cosign install
run: cosign version
- name: Install release tools
uses: jaxxstorm/[email protected]
with:
token: ${{ secrets.GH_RELEASE_DOWNLOAD }}
repo: saveoursecrets/release-tools
platform: 'linux'
arch: 'x86_64'
- name: Download artifacts
env:
AWS_REGION: ${{ env.RELEASE_REGION }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_RELEASE_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_RELEASE_SECRET_ACCESS_KEY }}
run: |
mkdir -p target/artifacts
release-artifact download \
--bucket $BUCKET \
--directory target/artifacts \
$CHANNEL/cli/$SEMVER/linux/x86_64/saveoursecrets.zip \
$CHANNEL/cli/$SEMVER/linux/x86_64/musl/saveoursecrets.zip \
$CHANNEL/cli/$SEMVER/windows/x86_64/saveoursecrets.zip \
$CHANNEL/cli/$SEMVER/macos/x86_64/saveoursecrets.zip \
$CHANNEL/cli/$SEMVER/macos/aarch64/saveoursecrets.zip
- name: Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: |
target/artifacts/*
LICENSE-APACHE
LICENSE-MIT
COPYRIGHT
- name: Update release notes
env:
SOS_GH_RELEASE_NOTES_TOKEN: ${{ secrets.SOS_GH_RELEASE_NOTES_TOKEN }}
AWS_REGION: ${{ env.RELEASE_REGION }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_RELEASE_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_RELEASE_SECRET_ACCESS_KEY }}
run: |
release-notes \
--bucket $BUCKET \
--channel $CHANNEL \
--collection cli \
--semver $SEMVER
- name: Index releases archive
env:
AWS_REGION: ${{ vars.RELEASE_REGION }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_RELEASE_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_RELEASE_SECRET_ACCESS_KEY }}
run: |
index-html s3 \
--bucket $BUCKET \
--page-title Releases