Bump actions/cache from 3.3.1 to 4.2.0 #224
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Go | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.20.x | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v3 | |
- name: go get | |
run: go get | |
- name: Cache go module | |
uses: actions/[email protected] | |
with: | |
path: ~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Get dependencies and run test | |
run: | | |
go test ./... | |
- name: gen go-bindata | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
go get -u github.com/go-bindata/go-bindata/... | |
go-bindata -o internal/bindata/geoip/geoip.go -pkg bingeoip assets/GeoLite2-City.mmdb assets/flags.json | |
- name: Build | |
if: startsWith(github.ref, 'refs/tags/') | |
env: | |
NAME: proxypool | |
BINDIR: bin | |
run: make -j releases | |
- name: Upload Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
files: bin/* | |
draft: true | |
prerelease: true | |
- uses: actions/upload-artifact@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
name: build | |
path: bin |