From ec03fb27e3bf242838e3c779a1d5d9bc7b1034a6 Mon Sep 17 00:00:00 2001 From: hang666 <44329474+hang666@users.noreply.github.com> Date: Fri, 2 Dec 2022 22:06:58 +0800 Subject: [PATCH] Create release.yml --- .github/workflows/release.yml | 40 +++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..e7f7c77 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,40 @@ +name: Release +on: [push] +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Setup Go + uses: actions/setup-go@v3 + with: + check-latest: true + go-version: '1.19.3' + + - name: Check out code into the Go module directory + uses: actions/checkout@v3 + + - name: Cache go module + uses: actions/cache@v2 + with: + path: | + ~/go/pkg/mod + ~/.cache/go-build + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + - name: Get dependencies, run test + run: | + go test ./... + - name: Build + if: startsWith(github.ref, 'refs/tags/') + env: + NAME: s5light + BINDIR: bin + run: make -j releases + + - name: Upload Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: bin/* + draft: true