-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (77 loc) · 2.67 KB
/
Copy pathrelease.yml
File metadata and controls
81 lines (77 loc) · 2.67 KB
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
name: Release
on:
push:
tags: [ "v*" ]
permissions:
contents: write
jobs:
build:
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
name: transcriptd-linux-amd64
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
name: transcriptd-linux-arm64
- target: x86_64-apple-darwin
os: macos-latest
name: transcriptd-macos-amd64
- target: aarch64-apple-darwin
os: macos-latest
name: transcriptd-macos-arm64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
with:
targets: ${{ matrix.target }}
- name: Install cross-compilation tools
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
- name: Build
run: cargo build --release --target ${{ matrix.target }}
- name: Package
run: |
mkdir -p dist
cp target/${{ matrix.target }}/release/transcriptd dist/${{ matrix.name }}
chmod +x dist/${{ matrix.name }}
tar czf dist/${{ matrix.name }}.tar.gz -C dist ${{ matrix.name }}
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: ${{ matrix.name }}
path: dist/${{ matrix.name }}.tar.gz
release:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
path: artifacts
- name: Create Release
uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 # v2
with:
files: artifacts/**/*.tar.gz
generate_release_notes: true
docker:
needs: build
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6
with:
push: true
tags: |
ghcr.io/vit0-9/transcriptd:${{ github.ref_name }}
ghcr.io/vit0-9/transcriptd:latest