summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorsjlleo <[email protected]>2022-05-20 17:50:49 +0800
committersjlleo <[email protected]>2022-05-20 17:50:49 +0800
commit39ec0454d1d2e5d0bf727eda0c176ce679174e0d (patch)
tree068d32a676cd6b1b376c1bf749a7aee18c722d9a /.github
parent9b1eb23c4c052f5eca396843c81de14cc08fae50 (diff)
Add: compile
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/build.yml29
-rw-r--r--.github/workflows/release.yaml29
2 files changed, 29 insertions, 29 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 0000000..6290f5b
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,29 @@
+on:
+ push: # 每次带有 tag 的 push 候触发
+ tags:
+ - 'v*'
+
+name: Build Release
+jobs:
+ release:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@master # checkout 代码
+ - uses: actions/setup-go@v2 # 配置 Go 环境
+ with:
+ go-version: "1.18" # 改成自己的版本
+
+ - run: bash .cross_compile.sh
+
+ - name: Release
+ uses: softprops/action-gh-release@v1
+ with: # 将下述可执行文件 release 上去
+ draft: false # Release草稿
+ files: |
+ dist/nf_darwin_amd64
+ dist/nf_darwin_arm64
+ dist/nf_linux_amd64
+ dist/nf_linux_arm64
+ dist/nf_linux_mips
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
deleted file mode 100644
index c620db4..0000000
--- a/.github/workflows/release.yaml
+++ /dev/null
@@ -1,29 +0,0 @@
-# .github/workflows/release.yaml
-on:
- push:
- branches:
- - master
-
-jobs:
- releases-matrix:
- name: Release Go Binary
- runs-on: ubuntu-latest
- strategy:
- matrix:
- # build and publish in parallel: linux/386, linux/amd64, windows/386, windows/amd64, darwin/amd64
- goos: [linux, windows, darwin]
- goarch: ["386", amd64]
- exclude:
- - goarch: "386"
- goos: darwin
- steps:
- - uses: actions/checkout@v2
- - uses: wangyoucao577/[email protected]
- with:
- github_token: ${{ secrets.GITHUB_TOKEN }}
- goos: ${{ matrix.goos }}
- goarch: ${{ matrix.goarch }}
- goversion: "https://dl.google.com/go/go1.13.1.linux-amd64.tar.gz"
- project_path: "./cmd/test-binary"
- binary_name: "test-binary"
- extra_files: LICENSE README.md