-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (49 loc) · 1.73 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
54
55
56
name: Release
on:
push:
branches:
- main
env:
CARGO_TERM_COLOR: always
jobs:
release-please:
runs-on: ubuntu-latest
outputs:
releases_created: ${{ steps.release.outputs.releases_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
major: ${{ steps.release.outputs.major }}
minor: ${{ steps.release.outputs.minor }}
patch: ${{ steps.release.outputs.patch }}
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
release-type: rust
upload:
name: Build and upload ${{ matrix.platform.target }}
runs-on: ${{ matrix.platform.os }}
needs: release-please
if: ${{ needs.release-please.outputs.releases_created == 'true' }}
env:
TAG_NAME: ${{ needs.release-please.outputs.major }}.${{ needs.release-please.outputs.minor }}.${{ needs.release-please.outputs.patch }}
strategy:
matrix:
platform:
- os: macos-latest
target: aarch64-apple-darwin
- os: macos-latest-large
target: x86_64-apple-darwin
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Rustup target
run: rustup target add ${{ matrix.platform.target }}
- name: Cargo build
run: cargo build --release --target ${{ matrix.platform.target }}
- name: Create tar and upload artifacts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd target/${{ matrix.platform.target }}/release
tar -czf tsc-cli-${{ env.TAG_NAME }}-${{ matrix.platform.target }}.tar.gz tsc-cli
gh release upload --clobber ${{ needs.release-please.outputs.tag_name }} tsc-cli-${{ env.TAG_NAME }}-${{ matrix.platform.target }}.tar.gz