-
Notifications
You must be signed in to change notification settings - Fork 1
125 lines (120 loc) · 4.26 KB
/
main.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
name: Build Tools
on:
push:
branches:
- main
tags: ['*']
workflow_dispatch:
jobs:
build-mac-arm:
runs-on: macos-latest
env:
TAG: ${{ github.ref_name }}
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
brew install just ninja
rustup install 1.75
rustup toolchain install 1.75
rustup default 1.75-aarch64-apple-darwin
- name: Clone
run: just clone
- name: Prepare
run: just prepare
- name: Build rust, cargo and newlib
run: just build-all
- name: Package
env:
APPLE_CODESIGN_IDENTITY: ${{ secrets.APPLE_CODESIGN_IDENTITY }}
APPLE_CRED: ${{ secrets.APPLE_CRED }}
APPLE_P12_BASE64: ${{ secrets.APPLE_P12_BASE64 }}
APPLE_P12_PASSWORD: ${{ secrets.APPLE_P12_PASSWORD }}
APPLE_TEAMID: ${{ secrets.APPLE_TEAMID }}
APPLE_TEMPKEYCHAIN_PASSWORD: ${{ secrets.APPLE_TEMPKEYCHAIN_PASSWORD }}
run: just package
- uses: actions/upload-artifact@v4
with:
name: platform-tools-osx-aarch64.tar.bz2
path: out/platform-tools-osx-aarch64.tar.bz2
build-mac-intel:
runs-on: macos-13
env:
TAG: ${{ github.ref_name }}
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
brew install just ninja
rustup install 1.75
rustup toolchain install 1.75
rustup default 1.75-x86_64-apple-darwin
- name: Clone
run: just clone
- name: Prepare
run: just prepare
- name: Build rust, cargo and newlib
run: just build-all
- name: Package
env:
APPLE_CODESIGN_IDENTITY: ${{ secrets.APPLE_CODESIGN_IDENTITY }}
APPLE_CRED: ${{ secrets.APPLE_CRED }}
APPLE_P12_BASE64: ${{ secrets.APPLE_P12_BASE64 }}
APPLE_P12_PASSWORD: ${{ secrets.APPLE_P12_PASSWORD }}
APPLE_TEAMID: ${{ secrets.APPLE_TEAMID }}
APPLE_TEMPKEYCHAIN_PASSWORD: ${{ secrets.APPLE_TEMPKEYCHAIN_PASSWORD }}
run: just package
- uses: actions/upload-artifact@v4
with:
name: platform-tools-osx-x86_64.tar.bz2
path: out/platform-tools-osx-x86_64.tar.bz2
build-linux:
runs-on: ubuntu-latest
env:
TAG: ${{ github.ref_name }}
steps:
- uses: actions/checkout@v4
- name: Install just
uses: taiki-e/install-action@just
- name: Install dependencies
run: |
sudo apt update; sudo apt install ninja-build
rustup install 1.75
rustup toolchain install 1.75
rustup default 1.75-x86_64-unknown-linux-gnu
- name: Clone
run: just clone
- name: Prepare
run: just prepare
- name: Build rust, cargo and newlib
run: just build-all
- name: Package
run: just package
- uses: actions/upload-artifact@v4
with:
name: platform-tools-linux-x86_64.tar.bz2
path: out/platform-tools-linux-x86_64.tar.bz2
release:
runs-on: ubuntu-latest
needs: [build-linux, build-mac-arm, build-mac-intel]
if: startsWith(github.event.ref, 'refs/tags/') # only on new tag creation
env:
TAG: ${{ github.ref_name }}
steps:
- uses: actions/checkout@v4
- name: Download artifact
uses: actions/download-artifact@v4
- name: Create a release
env:
GH_TOKEN: ${{ github.token }}
run: |
release_exist=$(gh release view $TAG 2>&1 || exit 0)
if [ "$release_exist" = "release not found" ]; then
gh release create $TAG certora-solana-platform-tools/platform-tools-osx-aarch64.tar.bz2 --title "Release $TAG" --generate-notes --latest
gh release upload $TAG certora-solana-platform-tools/platform-tools-osx-x86_64.tar.bz2
gh release upload $TAG certora-solana-platform-tools/platform-tools-linux-x86_64.tar.bz2
else
gh release upload $TAG certora-solana-platform-tools/platform-tools-osx-aarch64.tar.bz2
gh release upload $TAG certora-solana-platform-tools/platform-tools-osx-x86_64.tar.bz2
gh release upload $TAG certora-solana-platform-tools/platform-tools-linux-x86_64.tar.bz2
fi