diff options
author | sjlleo <[email protected]> | 2021-11-09 10:22:43 +0800 |
---|---|---|
committer | GitHub <[email protected]> | 2021-11-09 10:22:43 +0800 |
commit | 40f363424b666b5dea68cc6a3b4dd5481ba04db8 (patch) | |
tree | 89f578317c9c2e40cc9f8254176ce3ba5c549c3d | |
parent | eeb884a8bc9f41c03c01df14c6355f816015e3e9 (diff) |
Action Test
-rw-r--r-- | .github/workflows/go.yml | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 0000000..96de4ed --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,110 @@ +name: Go Release + +on: + release: + types: [published] + watch: + types: started + +jobs: + + release_macos_ubunty: + if: github.event.repository.owner.id == github.event.sender.id + name: Build with go ${{ matrix.go_version }} on ${{ matrix.os }} and upload + runs-on: ${{ matrix.os }} + env: + TZ: Asia/Shanghai + + strategy: + matrix: + go_version: [1.17.1] + os: [ubuntu-latest,macos-latest] + + steps: + + - name: Set up Go ${{ matrix.go_version }} + uses: actions/setup-go@v1 + with: + go-version: ${{ matrix.go_version }} + id: go + + - name: Check out code into the Go module directory + uses: actions/checkout@v1 + + - name: Build + run: | + go build -v -o netflix-verify . + - name: Gzip + run: | + mkdir netflix-${{ matrix.os }} + cp netflix-all-verify netflix-${{ matrix.os }} + tar -czvf netflix-${{ matrix.os }}.tar.gz netflix-${{ matrix.os }} + - name: Upload assets + uses: actions/upload-artifact@v2 + with: + name: netflix + path: netflix-${{ matrix.os }}.tar.gz + - name: Get current date + id: date + run: echo "::set-output name=today::$(date +'%Y-%m-%d')" + + - name: Upload release asset + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: netflix-${{ matrix.os }}.tar.gz + tag: ${{ steps.date.outputs.today }} + file_glob: true + overwrite: true + release_name: ${{ steps.date.outputs.today }} + + + release_windows-latest: + if: github.event.repository.owner.id == github.event.sender.id + name: Build with go ${{ matrix.go_version }} on ${{ matrix.os }} and upload + runs-on: ${{ matrix.os }} + env: + TZ: Asia/Shanghai + + strategy: + matrix: + go_version: [1.17.1] + os: [windows-latest] + + steps: + + - name: Set up Go ${{ matrix.go_version }} + uses: actions/setup-go@v1 + with: + go-version: ${{ matrix.go_version }} + id: go + + - name: Check out code into the Go module directory + uses: actions/checkout@v1 + + - name: Build + run: | + go build -v -o netflix-verify.exe . + - name: Gzip + run: | + mkdir netflix-${{ matrix.os }} + cp netflix-all-verify.exe netflix-${{ matrix.os }} + tar -czvf netflix-${{ matrix.os }}.tar.gz netflix-${{ matrix.os }} + - name: Upload assets + uses: actions/upload-artifact@v2 + with: + name: netflix + path: netflix-${{ matrix.os }}.tar.gz + - name: Get current date + id: date + run: echo "::set-output name=today::$(date +'%Y-%m-%d')" + + - name: Upload release asset + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: netflix-${{ matrix.os }}.tar.gz + tag: ${{ steps.date.outputs.today }} + file_glob: true + overwrite: true + release_name: ${{ steps.date.outputs.today }} |