-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (32 loc) · 930 Bytes
/
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
name: Release
on:
push:
branches:
- release*
tags:
- 'v*'
env:
# The NAME makes it easier to copy/paste snippets from other CI configs
NAME: fin-part-ord
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ncipollo/release-action@v1
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
with:
body: "See [CHANGELOG.md](https://github.com/langston-barrett/${NAME}/blob/main/CHANGELOG.md)"
draft: true
token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to crates.io
env:
CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
# Only push on actual release tags
PUSH: ${{ startsWith(github.ref, 'refs/tags/v') }}
run: |
if [[ ${PUSH} == true ]]; then
cargo publish --token ${CRATES_IO_TOKEN}
else
cargo publish --dry-run --token ${CRATES_IO_TOKEN}
fi