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
name: git-commit-helper
on:
push:
tags:
- "v*"
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: Build git-commit-helper
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- build: linux_x86_64
target: x86_64-unknown-linux-gnu
os: ubuntu-latest
command: sudo apt update && sudo apt-get install libssl-dev pkg-config -y
file: git-commit-helper
- build: macos_x86_64
target: x86_64-apple-darwin
os: macos-13
command: brew install openssl
file: git-commit-helper
- build: macos_arm64
target: aarch64-apple-darwin
os: macos-latest
command: brew install openssl
file: git-commit-helper
- build: windows_x86_64
target: x86_64-pc-windows-msvc
os: windows-latest
command: choco install openssl
file: git-commit-helper.exe
steps:
- uses: actions/checkout@v4
- name: Install Requirements
run: ${{ matrix.command }}
- name: Add Nasm
if: startsWith(matrix.os, 'windows')
uses: ilammy/setup-nasm@v1
- name: Add Target
run: rustup target add ${{ matrix.target }}
- name: Build
run: cargo build --release --target ${{ matrix.target }} --verbose
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: target/${{ matrix.target }}/release/${{ matrix.file }}
body: "Release of git-commit-helper"
token: ${{ secrets.ACCESS_TOKEN }}
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: target/${{ matrix.target }}/release/${{ matrix.file }}
asset_name: git-commit-helper-${{ matrix.target }}
asset_content_type: application/octet-stream