-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (45 loc) · 1.5 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
name: release-please
on:
push:
branches:
- main
permissions:
contents: write
pull-requests: write
jobs:
release-please:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- id: release
uses: google-github-actions/release-please-action@v3
with:
package-name: gen-completions
release-type: rust
bump-minor-pre-major: true
bump-patch-for-minor-pre-major: true
- uses: actions/checkout@v3
if: ${{ steps.release.outputs.release_created }}
# Publish to Cargo if release created
- run: cargo publish --verbose --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
if: ${{ steps.release.outputs.release_created }}
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
build:
name: Build (${{ matrix.os }})
runs-on: ${{ matrix.os }}
needs: release-please
if: needs.release-please.outputs.release_created
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v3
- run: cargo build --release
- run: mv ./target/release/gen-completions ./gen-completions-${{ matrix.os }}
- name: Upload executable for ${{ matrix.os }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ needs.release-please.outputs.tag_name }} ./gen-completions-${{ matrix.os }}