-
-
Notifications
You must be signed in to change notification settings - Fork 9
69 lines (64 loc) · 2.08 KB
/
release-please.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
name: release-please
on:
push:
branches: [main]
permissions:
contents: write
pull-requests: write
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
command: manifest
if: ${{ !env.ACT }}
outputs:
catwalk_release: ${{ steps.release.outputs['catwalk--release_created'] || env.ACT }}
catwalk_tag: ${{ steps.release.outputs['catwalk--tag_name'] }}
upload-catwalk:
name: Upload Catwalk for ${{ matrix.os }}
needs: release-please
runs-on: ${{ matrix.os }}
if: ${{ needs.release-please.outputs.catwalk_release }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
defaults:
run:
shell: bash
env:
MEMBER: catppuccin-catwalk
EXECUTABLE: catwalk
EXE_SUFFIX: ${{ matrix.os == 'windows-latest' && '.exe' || '' }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('./Cargo.lock') }}
- name: Build
id: build
run: |
cargo build --release --locked -p ${MEMBER}
cargo test --release --locked -p ${MEMBER}
export BINARY_NAME="${EXECUTABLE}-$(rustc --version --verbose | grep host | cut -d ' ' -f 2)"
mv "target/release/${EXECUTABLE}${EXE_SUFFIX}" "./${BINARY_NAME}"
echo "::set-output name=binary::${BINARY_NAME}"
- name: Upload to release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload "${{ needs.release-please.outputs.catwalk_tag }}" ${{ steps.build.outputs.binary }}
if: ${{ !env.ACT }}
- name: Upload to artifact
uses: actions/upload-artifact@v2
with:
name: ${{steps.build.outputs.binary}}
path: ${{steps.build.outputs.binary}}
if: ${{ env.ACT }}