yao/.github/workflows/release.yml
2022-02-09 23:28:13 +08:00

106 lines
2.9 KiB
YAML

name: Release
on:
push:
branches: [main]
paths:
- "share/const.go"
jobs:
release:
runs-on: ubuntu-latest
strategy:
matrix:
go: [1.17]
steps:
- name: Arm Build
run: |
sudo apt-get update
sudo apt-get install -y libc6-armel-cross libc6-dev-armel-cross binutils-arm-linux-gnueabi libncurses5-dev build-essential bison flex libssl-dev bc
sudo apt-get install -y gcc-arm-linux-gnueabi g++-arm-linux-gnueabi
sudo apt-get install -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf
sudo apt-get install -y g++-aarch64-linux-gnu crossbuild-essential-arm64
- name: Setup Cache
uses: actions/cache@v2
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Checkout Kun
uses: actions/checkout@v2
with:
repository: yaoapp/kun
path: kun
- name: Checkout Xun
uses: actions/checkout@v2
with:
repository: yaoapp/xun
path: xun
- name: Checkout Gou
uses: actions/checkout@v2
with:
repository: yaoapp/gou
path: gou
token: ${{ secrets.TOKEN }}
- name: Checkout UI
uses: actions/checkout@v2
with:
repository: yaoapp/xiang-ui
path: ui
token: ${{ secrets.TOKEN }}
- name: Move Kun, Xun, Gou, UI
run: |
mv kun ../
mv xun ../
mv gou ../
mv ui ../
ls -l .
ls -l ../
- name: Checkout Code
uses: actions/checkout@v2
- name: Setup Go ${{ matrix.go }}
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- name: Setup Go Tools
run: |
if [[ "${GO111MODULE}" = "on" ]]; then go mod download; fi
if [[ "${GO111MODULE}" = "on" ]]; then export PATH="${GOPATH}/bin:${GOROOT}/bin:${PATH}"; fi
if [[ "${GO111MODULE}" = "on" ]]; then make tools; fi
go get github.com/go-bindata/go-bindata/...
go get github.com/elazarl/go-bindata-assetfs/...
- name: Make Artifacts
run: |
make artifacts
- name: Push to Station (@Silicon Valley)
uses: nogsantos/scp-deploy@master
with:
src: ./dist/release/*
host: ${{ secrets.SSH_HOST }}
remote: /data/down/
port: ${{ secrets.SSH_PORT }}
user: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_KEY }}
- name: Distribution
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_KEY }}
port: ${{ secrets.SSH_PORT }}
script: ${{ secrets.SSH_CMD }}