-
Notifications
You must be signed in to change notification settings - Fork 3
68 lines (56 loc) · 2.88 KB
/
create-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
name: Create release
on: [workflow_dispatch]
permissions: write-all
jobs:
create-release:
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- name: Get latest artifacts
run: |
curl -L https://github.com/ton-blockchain/ton/releases/latest/download/ton-mac-arm64.zip -o ton-mac-arm64.zip
curl -L https://github.com/ton-blockchain/ton/releases/latest/download/ton-mac-x86-64.zip -o ton-mac-x86-64.zip
unzip ton-mac-arm64.zip -d ton-mac-arm64
unzip ton-mac-x86-64.zip -d ton-mac-x86-64
mkdir -p ton-brew-arm64/{bin,lib/fift,share/ton}
mkdir -p ton-brew-x86-64/{bin,lib/fift,share/ton}
cp -r ton-mac-arm64/smartcont ton-brew-arm64/share/ton/
cp ton-mac-arm64/lib/* ton-brew-arm64/lib/fift
rm -rf ton-mac-arm64/{lib,smartcont}
mv ton-mac-arm64/libtonlibjson* ton-brew-arm64/lib/
[ -e ton-mac-arm64/libemulator.dylib ] && mv ton-mac-arm64/libemulator.dylib ton-brew-arm64/lib/
cp ton-mac-arm64/* ton-brew-arm64/bin/
cd ton-brew-arm64
tar -cvf ton-brew-arm64.tar.gz *
cd ..
cp -r ton-mac-x86-64/smartcont ton-brew-x86-64/share/ton/
cp ton-mac-x86-64/lib/* ton-brew-x86-64/lib/fift
rm -rf ton-mac-x86-64/{lib,smartcont}
mv ton-mac-x86-64/libtonlibjson* ton-brew-x86-64/lib/
[ -e ton-mac-x86-64/libemulator.dylib ] && mv ton-mac-x86-64/libemulator.dylib ton-brew-x86-64/lib/
cp ton-mac-x86-64/* ton-brew-x86-64/bin/
cd ton-brew-x86-64
tar -cvf ton-brew-x86-64.tar.gz *
cd ..
mv ton-brew-arm64/ton-brew-arm64.tar.gz .
mv ton-brew-x86-64/ton-brew-x86-64.tar.gz .
rm -rf ton-brew-arm64 ton-brew-x86-64 ton-mac-arm64 ton-mac-arm64.zip ton-mac-x86-64 ton-mac-x86-64.zip
echo ton-brew-arm64 content:
tar -tvf ton-brew-arm64.tar.gz
echo ton-brew-x86-64 content:
tar -tvf ton-brew-x86-64.tar.gz
echo get checksums
SHA256_ARM64=$(shasum -a 256 ton-brew-arm64.tar.gz | cut -f 1 -d " ")
SHA256_AMD64=$(shasum -a 256 ton-brew-x86-64.tar.gz | cut -f 1 -d " ")
sed -i '' "s/sha256 \".*\" #arm64/sha256 \"$SHA256_ARM64\" #arm64/" ton.rb
sed -i '' "s/sha256 \".*\" #amd64/sha256 \"$SHA256_AMD64\" #amd64/" ton.rb
- name: Create release
run: |
LATEST_TAG=$(git ls-remote --tags https://github.com/ton-blockchain/ton/ | tail -1 | sed -n -e 's/^.*tags\///p')
echo "LATEST_TAG $LATEST_TAG"
git add ton.rb
git commit -m "create release" || true
git push
gh release create --notes "" $LATEST_TAG ./*.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}