mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-04-21 20:12:33 +03:00
52 lines
1.6 KiB
YAML
52 lines
1.6 KiB
YAML
on:
|
|
release:
|
|
types: [created]
|
|
|
|
jobs:
|
|
releases-matrix:
|
|
name: Release Go Binary
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
# build and publish in parallel: linux/386, linux/amd64, darwin/386, darwin/amd64
|
|
goos: [linux, darwin]
|
|
goarch: ["386", amd64]
|
|
steps:
|
|
# get the source code
|
|
- uses: actions/checkout@v2
|
|
|
|
# set environment
|
|
- name: Set APP_VERSION env
|
|
run: echo ::set-env name=APP_VERSION::$(echo ${GITHUB_REF} | rev | cut -d'/' -f 1 | rev )
|
|
- name: Set BUILD_TIME env
|
|
run: echo ::set-env name=BUILD_TIME::$(date)
|
|
- name: Environment Printer
|
|
uses: managedkaos/print-env@v1.0
|
|
|
|
# setup node
|
|
- uses: actions/setup-node@v1
|
|
with:
|
|
node-version: '10.x'
|
|
registry-url: 'https://registry.npmjs.org'
|
|
|
|
# prepare assets for go rice
|
|
- name: Prepare assets
|
|
run: |
|
|
chmod +x ./prepare_assets.sh
|
|
./prepare_assets.sh
|
|
|
|
# get go rice tool
|
|
- name: get go rice tool
|
|
run: go get github.com/GeertJohan/go.rice/rice
|
|
|
|
# build and make the releases
|
|
- uses: wangyoucao577/go-release-action@master
|
|
with:
|
|
pre_command: "/go/bin/rice embed-go"
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
goos: ${{ matrix.goos }}
|
|
goarch: ${{ matrix.goarch }}
|
|
goversion: "https://dl.google.com/go/go1.14.2.linux-amd64.tar.gz"
|
|
binary_name: "wireguard-ui"
|
|
build_flags: -v
|
|
ldflags: -X "main.appVersion=${{ env.APP_VERSION }}" -X "main.buildTime=${{ env.BUILD_TIME }}" -X main.gitCommit=${{ github.sha }} -X main.gitRef=${{ github.ref }}
|