forked from crypto-org-chain/chain-main
-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (96 loc) · 3.06 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
102
103
104
105
106
name: release
on:
push:
tags:
- "v*.*.*"
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
environment: release
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v23
with:
nix_path: nixpkgs=channel:nixos-22.11
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- uses: cachix/cachix-action@v12
with:
name: crypto-com
signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}"
- name: build binaries
env:
NETWORK: mainnet
run: |
# install sha256sum
nix-env -i coreutils -f '<nixpkgs>'
# build binaries
./scripts/release.sh
# update checksum and upload
sha256sum *.tar.gz > "checksums.txt"
echo 'FILES<<EOF' >> $GITHUB_ENV
ls -1 *.tar.gz >> $GITHUB_ENV
echo "checksums.txt" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
cat $GITHUB_ENV
- name: upload binaries
uses: softprops/action-gh-release@v1
with:
draft: true
files: "${{ env.FILES }}"
release-macos:
# runs sequentially to avoid creating duplicated release
needs: ["release"]
strategy:
matrix:
runner: [macos-latest, macos-14]
runs-on: ${{ matrix.runner }}
environment: release
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v23
with:
nix_path: nixpkgs=channel:nixos-22.11
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- uses: apple-actions/import-codesign-certs@v1
with:
p12-file-base64: ${{ secrets.MAC_CODE_SIGN_CERT }}
p12-password: ${{ secrets.MAC_CODE_SIGN_CERT_PASS }}
- uses: cachix/cachix-action@v12
with:
name: crypto-com
signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}"
- name: build binaries
env:
MAC_CODE_API_KEY: ${{ secrets.MAC_CODE_API_KEY }}
MAC_CODE_API_KEY_ID: ${{ secrets.MAC_CODE_API_KEY_ID }}
MAC_CODE_API_ISSUER_ID: ${{ secrets.MAC_CODE_API_ISSUER_ID }}
MAC_CODE_API_DEVELOPER_ID: ${{ secrets.MAC_CODE_API_DEVELOPER_ID }}
NETWORK: mainnet
run: |
# install sha256sum
nix-env -i coreutils -f '<nixpkgs>'
# build binaries
./scripts/release.sh
# codesign
for tarball in *.tar.gz;
do
./scripts/codesign_macos.sh $tarball
mv signed.tar.gz $tarball
done
# update checksum and upload
CHKFILE="checksums-darwin-$(uname -p).txt"
sha256sum *.tar.gz > "$CHKFILE"
echo 'FILES<<EOF' >> $GITHUB_ENV
ls -1 *.tar.gz >> $GITHUB_ENV
echo "$CHKFILE" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
cat $GITHUB_ENV
- name: upload binaries
uses: softprops/action-gh-release@v1
with:
draft: true
files: "${{ env.FILES }}"