-
Notifications
You must be signed in to change notification settings - Fork 4
64 lines (54 loc) · 1.64 KB
/
rust.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
name: "publish"
on:
push:
branches:
- release
# This is the example from the readme.
# On each push to the `release` branch it will create or update a GitHub release, build your app, and upload the artifacts to the release.
env:
CARGO_TERM_COLOR: always
jobs:
build-and-release:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
platform: [macos-latest, ubuntu-20.04, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: Build
run: cargo build --release
# Set up the GitHub CLI
- name: Install GitHub CLI
run: |
brew install gh
if: matrix.platform == 'macos-latest'
- name: Install GitHub CLI
run: |
sudo apt install -y gh
if: matrix.platform == 'ubuntu-20.04'
- name: Install GitHub CLI
run: |
choco install gh
if: matrix.platform == 'windows-latest'
# Log in to the GitHub CLI
- name: Login to GitHub CLI
run: echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token
# Create a release
- name: Create Release
id: create_release
run: |
gh release create ${{ github.ref_name }} \
--title "Release ${{ github.ref_name }}" \
--notes "Release notes for ${{ github.ref_name }}" \
--draft
shell: bash
# Upload the built artifact to the release
- name: Upload Release Asset
run: |
gh release upload ${{ github.ref_name }} \
./target/release/ncbi \
--clobber
shell: bash