-
-
Notifications
You must be signed in to change notification settings - Fork 3
56 lines (47 loc) · 1.36 KB
/
release_publish.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
name: Release & Publish Workflow
on:
workflow_dispatch:
jobs:
check-tag:
runs-on: ubuntu-latest
outputs:
tag_exists: ${{ steps.tag_check.outputs.tag_exists }}
steps:
- uses: actions/checkout@v2
- name: Check for Tag
id: tag_check
run: |
TAG=$(git tag --points-at HEAD)
if [ -z "$TAG" ]; then
echo "tag_exists=false" >> $GITHUB_ENV
echo "tag_exists=false" >> $GITHUB_OUTPUT
else
echo "tag_exists=true" >> $GITHUB_ENV
echo "tag_exists=true" >> $GITHUB_OUTPUT
fi
shell: bash
build-and-release:
# needs: check-tag
# if: needs.check-tag.outputs.tag_exists == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Test Build
run: cargo build --release
- name: Publish to Cargo
run: cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
- name: Build Linux Executable
run: cargo build --release --target x86_64-unknown-linux-gnu
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
files: target/x86_64-unknown-linux-gnu/release/turbocommit
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}