Skip to content

Create release

Create release #15

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 }}