-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (45 loc) · 1.72 KB
/
release.yaml
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
name: Release
on:
release:
types: [published]
jobs:
release:
runs-on: ${{ matrix.job.os }}
env:
PROJECT_NAME: point_tiler
strategy:
fail-fast: false
matrix:
job:
- {os: macos-latest, target: x86_64-apple-darwin, extension: ''}
- {os: macos-latest, target: aarch64-apple-darwin, extension: ''}
- {os: ubuntu-latest, target: x86_64-unknown-linux-gnu, extension: ''}
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Rust setup
uses: dtolnay/rust-toolchain@stable
with:
targets: |
x86_64-apple-darwin
aarch64-apple-darwin
x86_64-unknown-linux-gnu
- name: Rust cache
uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build --release --package app --target ${{ matrix.job.target }}
- name: Rename artifact
run: |
mv ./target/${{ matrix.job.target }}/release/app \
./target/${{ matrix.job.target }}/release/${{ env.PROJECT_NAME }}-${{ github.ref_name }}-${{ matrix.job.target }}${{ matrix.job.extension }}
- name: Upload artifact to release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./target/${{ matrix.job.target }}/release/${{ env.PROJECT_NAME }}-${{ github.ref_name }}-${{ matrix.job.target }}${{ matrix.job.extension }}
asset_name: ${{ env.PROJECT_NAME }}-${{ github.ref_name }}-${{ matrix.job.target }}${{ matrix.job.extension }}
asset_content_type: application/octet-stream