-
Notifications
You must be signed in to change notification settings - Fork 0
113 lines (95 loc) · 3.06 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
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
name: release
on:
push:
branches:
- master
jobs:
github:
runs-on: ubuntu-24.04
if: "contains(github.event.head_commit.message, 'chore: release')"
steps:
- run: sudo apt-get install -y libpango1.0-dev libgraphene-1.0-dev
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: dtolnay/rust-toolchain@stable
- uses: MarcoIeni/[email protected]
with:
command: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
linux:
name: linux / ${{ matrix.target }}
runs-on: ubuntu-latest
needs: github
strategy:
fail-fast: false
matrix:
target:
- aarch64-unknown-linux-gnu
- aarch64-unknown-linux-musl
- i686-unknown-linux-gnu
- x86_64-unknown-linux-gnu
- x86_64-unknown-linux-musl
steps:
- uses: actions/checkout@v4
with:
fetch-tags: true
- uses: actions-rs/cargo@v1
with:
command: build
args: --release --target ${{ matrix.target }}
- uses: actions/upload-artifact@v4
with:
name: turbine-${{ matrix.target }}
path: target/${{ matrix.target }}/release/turbine
- name: Upload artifacts to release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
run: |
for tag in $(git tag --points-at HEAD); do
if cp target/${{ matrix.target }}/release/turbine turbine_${{ matrix.target }}; then
gh release upload "${tag##*-}" "turbine_${{ matrix.target }}"
fi
done
docker:
runs-on: ubuntu-latest
needs: linux
steps:
- uses: actions/checkout@v4
with:
fetch-tags: true
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: actions/download-artifact@v4
with:
name: turbine-x86_64-unknown-linux-musl
path: turbine/linux-amd64
- uses: actions/download-artifact@v4
with:
name: turbine-aarch64-unknown-linux-musl
path: turbine/linux-arm64
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Find version tags
id: get_tags
run: |
for tag in $(git tag --points-at HEAD); do
echo "turbine=${tag##*-}" >>"$GITHUB_OUTPUT"
done
- uses: docker/build-push-action@v5
if: ${{ steps.get_tags.outputs.turbine != '' }}
with:
context: .
platforms: linux/amd64 #,linux/arm64,linux/arm/v7
push: true
tags: fossable/turbine:latest,fossable/turbine:${{ steps.get_tags.outputs.turbine }}
- uses: peter-evans/dockerhub-description@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: fossable/turbine