-
Notifications
You must be signed in to change notification settings - Fork 2
44 lines (42 loc) · 1.23 KB
/
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
38
39
40
41
42
43
44
name: Release
on:
push:
branches:
- '*'
- '!master'
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Test
run: make test
# Keep in mind that tags should only be in one of the following formats
# v<VERSION> or v<VERSION>-<RELEASE> e.g. v0.8.5 or v0.8.5-1
- name: Set environment variables
run: |-
CURRENT_BRANCH=${GITHUB_REF#refs/*/}
echo "Current branch or tag: ${CURRENT_BRANCH}"
if [[ "$CURRENT_BRANCH" != "master" ]] && [[ $CURRENT_BRANCH != v* ]]; then
CURRENT_BRANCH="v0.0.0-Unknown"
echo "Overridden branch or tag: ${CURRENT_BRANCH}"
fi
echo "CURRENT_TAG=${CURRENT_BRANCH}" >> $GITHUB_ENV
- name: Build
run: ./scripts/build.py
- name: Checksum
run: sha256sum ./dist/*
- name: Create release and upload assets
run: ./scripts/upload.py $(cat targets.txt)
if: startsWith(github.ref, 'refs/tags/v')
env:
REPO_OWNER: maximumadmin
REPO_NAME: zramd
GH_RELEASE_TOKEN: ${{ secrets.GH_RELEASE_TOKEN }}