forked from ton-blockchain/ton
-
Notifications
You must be signed in to change notification settings - Fork 3
84 lines (70 loc) · 2.3 KB
/
ton-nix-python-dev.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
name: "TON DEV: macos build"
on:
push:
branches: [ dev ]
pull_request:
branches: [ dev ]
workflow_dispatch:
workflow_call:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
strategy:
matrix:
arch: [aarch64]
os: [macos-14]
python: [312]
runs-on: ${{ matrix.os }}
steps:
- name: Install QEMU
uses: docker/setup-qemu-action@v2
if: matrix.os == 'arc-runner-set' && matrix.arch == 'aarch64'
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- uses: cachix/install-nix-action@v22
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
${{ matrix.nix-extra }}
env:
USER: runner
- uses: cachix/cachix-action@v12
with:
name: disintar
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
env:
USER: runner
- run: |
export KERNEL=$(nix eval --raw 'nixpkgs#hostPlatform.parsed.kernel.name')
echo "TARGET_SYSTEM=${{ matrix.arch }}-$KERNEL" >> $GITHUB_ENV
echo "RELEASE_NAME=ton-cpython-${{ matrix.python }}-${{ matrix.arch }}-$KERNEL" >> $GITHUB_ENV
- name: Compile
run: nix build .?submodules=1#packages."$TARGET_SYSTEM".ton-python-${{ matrix.python }}
--print-build-logs
- name: Copy binaries
run: |
ls -lart
mkdir artifacts
cp $PWD/result/lib/* artifacts/
- name: Simple binaries test
run: nix develop .#packages."$TARGET_SYSTEM".ton-python-${{ matrix.python }}
-c bash -c "cd artifacts; python3 -c 'import python_ton'"
- name: Upload artifacts
uses: actions/upload-artifact@master
with:
name: ${{ env.RELEASE_NAME }}
path: artifacts
- name: Upload artifacts
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} ||
${{ github.event_name == 'workflow_dispatch' }}
uses: workflow/[email protected]
with:
flakes: nixpkgs#gh
script: |
gh release delete -y "$RELEASE_NAME" || true
gh release create --notes "" "$RELEASE_NAME" artifacts/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}