-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (51 loc) · 1.45 KB
/
deploy.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
name: Deploy
run-name: ${{ github.event_name == 'release' && github.ref_name || inputs.version }}
concurrency:
cancel-in-progress: false
group: '${{ github.workflow }}'
on:
release:
types:
- published
- edited
workflow_dispatch:
inputs:
version:
description: The version (the release name) to deploy
type: string
required: true
permissions:
contents: read
jobs:
setup:
name: Setup references
runs-on: ubuntu-latest
outputs:
ref: ${{ steps.ref.outputs.ref }}
steps:
- name: Trigger on release
if: ${{ github.event_name == 'release' }}
run: echo "REF=${{ github.ref_name }}" >> "$GITHUB_ENV"
- name: Trigger on manual dispatch
if: ${{ github.event_name == 'workflow_dispatch' }}
run: echo "REF=${{ inputs.version }}" >> "$GITHUB_ENV"
- name: Set reference
id: ref
run: echo "ref=$REF" >> "$GITHUB_OUTPUT"
build:
name: Build
runs-on: ubuntu-latest
needs: setup
steps:
- uses: actions/checkout@v3
- name: Install Rust
run: |
rustup set profile minimal
rustup toolchain install stable
rustup default stable
- name: Build cli
run: cargo build --release
- name: Attach to release
env:
GITHUB_TOKEN: ${{ secrets.GH_ADMIN_TOKEN }}
run: gh release upload ${{needs.setup.outputs.ref}} ./target/release/powerd6_tools --clobber