mirror of
https://github.com/p4gefau1t/trojan-go.git
synced 2024-04-21 12:21:34 +00:00
38 lines
925 B
YAML
38 lines
925 B
YAML
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
name: release-build
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Install Go
|
|
uses: actions/setup-go@v1
|
|
with:
|
|
go-version: 1.14.x
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
- name: Checkout tag
|
|
run: |
|
|
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
|
|
tag_name="${GITHUB_REF##*/}"
|
|
echo Tag $tag_name
|
|
git checkout $tag_name
|
|
- name: Build
|
|
run: |
|
|
./build-all.sh
|
|
set -x
|
|
assets=()
|
|
for asset in ./release/*; do
|
|
assets+=("-a" "$asset")
|
|
done
|
|
tag_name="${GITHUB_REF##*/}"
|
|
hub release create -p -d "${assets[@]}" -m "$tag_name" "$tag_name"
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Upload binary
|
|
uses: actions/upload-artifact@v1
|
|
with:
|
|
name: dist-release
|
|
path: ./release |