-
Notifications
You must be signed in to change notification settings - Fork 6
118 lines (97 loc) · 3.03 KB
/
release.yaml
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
name: Release
on:
pull_request:
types: [closed]
branches: [main]
jobs:
build-artifacts:
env:
archive_name: artifact
strategy:
fail-fast: false
matrix:
pkg: [fuel-core-nats]
os: [ubuntu-latest]
target: [x86_64-unknown-linux-gnu]
runs-on: ${{ matrix.os }}
name: ${{ matrix.pkg }} ${{ matrix.target }}
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: ./.github/actions/setup-rust
with:
toolchain: stable
target: wasm32-unknown-unknown
- name: Install host target
run: rustup target add ${{ matrix.target }}
- name: Build
run: make build TARGET=${{ matrix.target }} PACKAGE=${{ matrix.pkg }}
- name: Set Archive Name
id: archive
run: echo "archive_name=${{ matrix.pkg }}-${{ matrix.target }}" >> $GITHUB_ENV
- name: Create Tar Archive
run: |
mkdir ${{ env.archive_name }}
cp target/${{ matrix.target }}/release/${{ matrix.pkg }} ${{ env.archive_name }}
tar -czf ${{ env.archive_name }}.tgz ${{ env.archive_name }}
- name: Upload Artifact
uses: actions/upload-artifact@v4.3.3
with:
name: ${{ matrix.pkg }}-${{ matrix.target }}
path: ${{ env.archive_name }}.tgz
if-no-files-found: error
release:
needs: [build-artifacts]
runs-on: ubuntu-latest
permissions:
contents: read
actions: write
steps:
- name: Checkout Repository
uses: actions/checkout@v4.1.6
- name: Download Artifacts
uses: actions/download-artifact@v4.1.7
with:
path: artifacts
merge-multiple: true
- name: List Artifacts
run: ls -R artifacts
- name: Cache Artifacts
uses: actions/cache@v4
with:
path: artifacts
key: ${{ runner.os }}-artifacts-${{ github.sha }}
restore-keys: |
${{ runner.os }}-artifacts-
- name: Run Knope Action
uses: knope-dev/action@v2.1.0
with:
github-token: ${{ secrets.REPO_TOKEN }}
- name: Knope Release
run: knope release
env:
github-token: ${{ secrets.REPO_TOKEN }}
publish-crates:
needs: [release]
if: github.event_name == 'release' && github.event.action == 'published'
runs-on: buildjet-4vcpu-ubuntu-2204
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Restore Artifacts Cache
uses: actions/cache@v4
with:
path: artifacts
key: ${{ runner.os }}-artifacts-${{ github.sha }}
restore-keys: |
${{ runner.os }}-artifacts-
- name: Install Rust Toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_VERSION }}
targets: wasm32-unknown-unknown
- name: Publish Crate
uses: FuelLabs/publish-crates@v1
with:
publish-delay: 60000
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}