Skip to content

Commit b4c0a47

Browse files
committed
Fixed GH actions
1 parent 7c16b75 commit b4c0a47

File tree

2 files changed

+33
-90
lines changed

2 files changed

+33
-90
lines changed

.github/workflows/release.yml

+33-50
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,40 @@
1-
name: Release
2-
3-
permissions:
4-
contents: write
1+
# .github/workflows/release.yml
52

63
on:
7-
push:
8-
tags:
9-
- v[0-9]+.*
4+
release:
5+
types:
6+
- created
107

118
jobs:
12-
create-release:
9+
linux_windows:
1310
runs-on: ubuntu-latest
1411
steps:
15-
- uses: actions/checkout@v4
16-
- uses: taiki-e/create-gh-release-action@v1
17-
with:
18-
# (optional) Path to changelog.
19-
changelog: CHANGELOG.md
20-
# (required) GitHub token for creating GitHub Releases.
21-
token: ${{ secrets.GITHUB_TOKEN }}
22-
23-
upload-assets:
24-
needs: create-release
25-
strategy:
26-
matrix:
27-
include:
28-
- target: x86_64-unknown-linux-gnu
29-
os: ubuntu-latest
30-
- target: x86_64-apple-darwin
31-
os: macos-latest
32-
- target: x86_64-pc-windows-msvc
33-
os: windows-latest
34-
runs-on: ${{ matrix.os }}
35-
steps:
36-
- uses: actions/checkout@v4
37-
- uses: taiki-e/upload-rust-binary-action@v1
12+
- name: Checkout the repository
13+
uses: actions/checkout@v2
14+
15+
- name: Install Linux and Windows Cross Compilers
16+
run: sudo apt-get install --yes --no-install-recommends musl-tools gcc-mingw-w64-x86-64-win32
17+
18+
- name: Install rustup targets
19+
run: rustup target add x86_64-unknown-linux-musl x86_64-pc-windows-gnu
20+
21+
- name: Build the executable
22+
run: cargo build --release --target x86_64-unknown-linux-musl --target x86_64-pc-windows-gnu
23+
24+
- name: Tar x86_64 binary
25+
run: tar -czvf fingerprinter-rs-gnu-linux-x86_64.tar.gz -C target/x86_64-unknown-linux-musl/release fingerprinter-rs
26+
27+
- name: Zip windows binary
28+
run: zip -j fingerprinter-rs-windows.zip target/x86_64-pc-windows-gnu/release/fingerprinter-rs.exe
29+
30+
- name: Generate SHA256 checksums
31+
run: |
32+
shasum -a 256 fingerprinter-rs-gnu-linux-x86_64.tar.gz > fingerprinter-rs-gnu-linux-x86_64.tar.gz.sha256
33+
shasum -a 256 fingerprinter-rs-windows.zip > fingerprinter-rs-windows.zip.sha256
34+
35+
- name: Upload release binaries
36+
uses: alexellis/upload-assets@0.4.0
37+
env:
38+
GITHUB_TOKEN: ${{ github.token }}
3839
with:
39-
# (required) Comma-separated list of binary names (non-extension portion of filename) to build and upload.
40-
# Note that glob pattern is not supported yet.
41-
bin: fingerprinter-rs
42-
# (optional) Target triple, default is host triple.
43-
# This is optional but it is recommended that this always be set to
44-
# clarify which target you are building for if macOS is included in
45-
# the matrix because GitHub Actions changed the default architecture
46-
# of macos-latest since macos-14.
47-
target: ${{ matrix.target }}
48-
# (optional) On which platform to distribute the `.tar.gz` file.
49-
# [default value: unix]
50-
# [possible values: all, unix, windows, none]
51-
tar: unix
52-
# (optional) On which platform to distribute the `.zip` file.
53-
# [default value: windows]
54-
# [possible values: all, unix, windows, none]
55-
zip: windows
56-
# (required) GitHub token for uploading assets to GitHub Releases.
57-
token: ${{ secrets.GITHUB_TOKEN }}
40+
asset_paths: '["fingerprinter-rs-gnu-linux-x86_64.tar.gz", "fingerprinter-rs-windows.zip", "fingerprinter-rs-gnu-linux-x86_64.tar.gz.sha256", "fingerprinter-rs-windows.zip.sha256"]'

.github/workflows/rust.yml

-40
This file was deleted.

0 commit comments

Comments
 (0)