-
Notifications
You must be signed in to change notification settings - Fork 174
113 lines (102 loc) · 3.02 KB
/
publish.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
name: "Publish nox"
on:
workflow_dispatch:
inputs:
tag:
type: string
description: "tag to publish"
required: true
version:
type: string
description: "nox version"
required: true
update-distro:
type: string
description: "whether to update nox-distro"
required: true
workflow_call:
inputs:
tag:
type: string
description: "tag to publish"
required: true
version:
type: string
description: "nox version"
required: true
update-distro:
type: string
description: "whether to update nox-distro"
required: true
secrets:
PERSONAL_TOKEN:
description: "A token passed from the caller workflow"
required: true
jobs:
nox:
runs-on: builder
timeout-minutes: 60
permissions:
contents: write
id-token: write
outputs:
sha256_x86_64: ${{ steps.sha.outputs.sha256_x86_64 }}
sha256_aarch64: ${{ steps.sha.outputs.sha256_aarch64 }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Import secrets
uses: hashicorp/vault-action@v2.5.0
with:
url: https://vault.fluence.dev
path: jwt/github
role: ci
method: jwt
jwtGithubAudience: "https://github.com/fluencelabs"
jwtTtl: 300
exportToken: false
secrets: |
kv/crates.io/fluencebot token | CARGO_REGISTRY_TOKEN
- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Build nox binary
env:
RUSTFLAGS: "--cfg tokio_unstable"
run: cargo build --release -p nox
- name: Calculate SHA256
id: sha
run: |
# Calculate sha256
for arch in x86_64 aarch64; do
mv ./target/release/nox-${arch}/nox nox-${arch}
du -hs nox-${arch}
sha256sum nox-${arch} | tee >> nox_SHA256_SUMS
sha=($(sha256sum nox-${arch}))
echo "sha256_${arch}=${sha}" >> $GITHUB_OUTPUT
done
- name: Upload nox binary
uses: softprops/action-gh-release@v1
with:
files: |
./nox-x86_64
./nox-aarch64
./nox_SHA256_SUMS
tag_name: ${{ inputs.tag }}
distro:
if: inputs.update-distro == 'true'
needs: rust-peer
uses: fluencelabs/nox-distro/.github/workflows/update_fluence.yml@main
with:
version: |
{
"x86_64": {
"version": "${{ inputs.version }}",
"url": "https://github.com/fluencelabs/nox/releases/download/${{ inputs.tag }}/nox-x86_64",
"sha256": "${{ needs.nox.outputs.sha256_x86_64 }}"
},
"aarch64": {
"version": "${{ inputs.version }}",
"url": "https://github.com/fluencelabs/nox/releases/download/${{ inputs.tag }}/nox-aarch64",
"sha256": "${{ needs.nox.outputs.sha256_aarch64 }}"
}
}