github.com/xxf098/lite-proxy@v0.15.1-0.20230422081941-12c69f323218/.github/workflows/release.yaml (about)

     1  name: Go
     2  on: [push, pull_request]
     3  jobs:
     4  
     5    build:
     6      name: Build
     7      runs-on: ubuntu-latest
     8      steps:
     9        - name: Check out code into the Go module directory
    10          uses: actions/checkout@v3    
    11        - name: Setup Go
    12          uses: actions/setup-go@v3
    13          with:
    14            go-version: 1.20.1
    15            cache: true
    16        - uses: actions/setup-node@v3
    17          with:
    18            node-version: 16
    19  
    20        - name: Get dependencies, run test and static check
    21          run: |
    22            # LATESTTAG=$(git describe --tags --abbrev=0)
    23            # sed -i "s/v[0-9]\+\.[0-9]\+\.[0-9]\+/$LATESTTAG/" ./constant/version.go
    24            go version
    25            cp $(go env GOROOT)/misc/wasm/wasm_exec.js ./web/gui/wasm_exec.js
    26            npm install --prefix web/gui build
    27            NODE_ENV=production  npm run --prefix web/gui build
    28            GOOS=js GOARCH=wasm go get -u ./...
    29            GOOS=js GOARCH=wasm go build -o ./web/gui/dist/main.wasm ./wasm
    30  
    31        - name: Build
    32          if: startsWith(github.ref, 'refs/tags/')
    33          env:
    34            NAME: lite
    35            BINDIR: bin
    36          run: make -j releases
    37  
    38        - name: Upload Release
    39          uses: softprops/action-gh-release@v1
    40          if: startsWith(github.ref, 'refs/tags/')
    41          env:
    42            GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    43          with:
    44            files: bin/*
    45            draft: true