-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (63 loc) · 2.08 KB
/
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
69
70
71
72
73
74
name: Release
on:
push:
tags:
- 'v*'
jobs:
build_and_release:
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-pc-windows-gnu
os: windows-latest
- target: x86_64-apple-darwin
os: macos-latest
- target: aarch64-apple-darwin
os: macos-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true
- name: Build
run: cargo build --release --target ${{ matrix.target }}
- name: Package
shell: bash
run: |
cd target/${{ matrix.target }}/release
echo "Current directory:"
pwd
echo "Files available for packaging:"
ls -l
tar czvf ../../../minos-codex-${{ matrix.target }}-${{ matrix.os }}.tar.gz minos-codex* || echo "Tar command failed with exit code $?"
echo "Check if tar.gz was created:"
ls -l ../../../
cd -
- name: List Packaged Files
run: ls -l target/${{ matrix.target }}/release/
- name: Generate SHA256
shell: bash
run: |
cd target/${{ matrix.target }}/release
if [[ "${{ matrix.os }}" == "macos-latest" ]]; then
shasum -a 256 ../../../minos-codex-${{ matrix.target }}-${{ matrix.os }}.tar.gz > ../../../minos-codex-${{ matrix.target }}-${{ matrix.os }}.sha256
else
sha256sum ../../../minos-codex-${{ matrix.target }}-${{ matrix.os }}.tar.gz > ../../../minos-codex-${{ matrix.target }}-${{ matrix.os }}.sha256
fi
cd -
- name: List SHA256 Files
run: ls -l target/${{ matrix.target }}/release/
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
minos-codex-${{ matrix.target }}-${{ matrix.os }}.tar.gz
minos-codex-${{ matrix.target }}-${{ matrix.os }}.sha256
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}