|
| 1 | +# .github/workflows/tag.yaml |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - "v*.*.*" |
| 7 | + |
| 8 | +jobs: |
| 9 | + build: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + steps: |
| 12 | + - name: Checkout |
| 13 | + uses: actions/checkout@v3 |
| 14 | + - name: Release |
| 15 | + uses: softprops/action-gh-release@v1 |
| 16 | + releases-matrix: |
| 17 | + name: Release Go Binary |
| 18 | + runs-on: ubuntu-latest |
| 19 | + strategy: |
| 20 | + matrix: |
| 21 | + goos: [ linux, windows, darwin ] |
| 22 | + goarch: [ amd64, arm64 ] |
| 23 | + exclude: |
| 24 | + - goarch: arm64 |
| 25 | + goos: windows |
| 26 | + steps: |
| 27 | + - uses: actions/checkout@v3 |
| 28 | + - name: Set APP_VERSION env |
| 29 | + run: echo APP_VERSION=$(echo ${GITHUB_REF} | rev | cut -d'/' -f 1 | rev ) >> ${GITHUB_ENV} |
| 30 | + - name: Set BUILD_TIME env |
| 31 | + run: echo BUILD_TIME=$(date) >> ${GITHUB_ENV} |
| 32 | + - name: Set REPO_URL env |
| 33 | + run: echo REPO_URL=$(echo "github.com/${GITHUB_REPOSITORY}/") >> ${GITHUB_ENV} |
| 34 | + - name: Environment Printer |
| 35 | + uses: managedkaos/print-env@v1.0 |
| 36 | + - uses: wangyoucao577/go-release-action@v1.33 |
| 37 | + with: |
| 38 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 39 | + goos: ${{ matrix.goos }} |
| 40 | + goarch: ${{ matrix.goarch }} |
| 41 | + goversion: "https://dl.google.com/go/go1.19.3.linux-amd64.tar.gz" |
| 42 | + binary_name: "pornhubdownloader" |
| 43 | + extra_files: README.md |
| 44 | + pre_command: export GO_PRIVATE=github.com/RoyalFlyBy/* && export GO_NO_SUMDB=github.com/RoyalFlyBy/* && git config --global url."https://oauth:${{secrets.GIT_AUTH}}@github.com/".insteadOf "https://github.com/" |
| 45 | + ldflags: -X "${{ env.REPO_URL }}app.GitRepo=https://${{ env.REPO_URL }}" -X "${{ env.REPO_URL }}app.AppVersion=${{ env.APP_VERSION }}" -X "${{ env.REPO_URL }}app.BuildTime=${{ env.BUILD_TIME }}" -X ${{ env.REPO_URL }}app.GitCommit=${{ github.sha }} -X ${{ env.REPO_URL }}app.GitRef=${{ github.ref }} |
0 commit comments