-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (48 loc) · 1.42 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
56
57
name: Create Release
on:
workflow_dispatch:
push:
branches: [main]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PASSAGE_APP_ID: ${{ secrets.PASSAGE_APP_ID }}
PASSAGE_API_KEY: ${{ secrets.PASSAGE_API_KEY }}
PASSAGE_USER_ID: ${{ secrets.PASSAGE_USER_ID }}
PASSAGE_AUTH_TOKEN: ${{ secrets.PASSAGE_AUTH_TOKEN }}
jobs:
build:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v2
- name: Checkout code
uses: actions/checkout@v2
- name: Test
run: go test ./...
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Read version
run: |
echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV
- name: Check if release is needed
id: check
run: |
_last_version=`git describe --tags --abbrev=0`
if [[ "$VERSION" == "$_last_version" ]]; then
# no release needed
echo ::set-output name=create_release::false
else
echo ::set-output name=create_release::true
fi
- name: Create Release
if: ${{ steps.check.outputs.create_release == 'true' }}
id: create_release
uses: actions/create-release@v1
with:
tag_name: ${{ env.VERSION }}
release_name: Release ${{ env.VERSION }}
draft: false
prerelease: false