v1.0.0 #4
Workflow file for this run
This file contains hidden or 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: Build warpscanner | |
| on: | |
| workflow_dispatch: | |
| release: | |
| types: [published] | |
| push: | |
| jobs: | |
| build: | |
| permissions: | |
| contents: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - goos: darwin | |
| goarch: amd64 | |
| - goos: darwin | |
| goarch: arm64 | |
| - goos: android | |
| goarch: arm64 | |
| - goos: linux | |
| goarch: amd64 | |
| - goos: linux | |
| goarch: arm64 | |
| - goos: linux | |
| goarch: arm | |
| goarm: 7 | |
| - goos: linux | |
| goarch: riscv64 | |
| - goos: linux | |
| goarch: mips | |
| - goos: linux | |
| goarch: mipsle | |
| - goos: linux | |
| goarch: mips64 | |
| - goos: linux | |
| goarch: mips64le | |
| - goos: linux | |
| goarch: mips | |
| gomips: softfloat | |
| - goos: linux | |
| goarch: mipsle | |
| gomips: softfloat | |
| - goos: linux | |
| goarch: mips64 | |
| gomips: softfloat | |
| - goos: linux | |
| goarch: mips64le | |
| gomips: softfloat | |
| - goos: windows | |
| goarch: amd64 | |
| - goos: windows | |
| goarch: arm64 | |
| - goos: windows | |
| goarch: 386 | |
| runs-on: ubuntu-latest | |
| env: | |
| GOOS: ${{ matrix.goos }} | |
| GOARCH: ${{ matrix.goarch }} | |
| GOARM: ${{ matrix.goarm || '' }} | |
| GOMIPS: ${{ matrix.gomips || '' }} | |
| CGO_ENABLED: 0 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Show build context | |
| run: | | |
| export NAME=$GOOS-$GOARCH${GOARM}${GOMIPS} | |
| echo "ASSET_NAME=$NAME" >> $GITHUB_ENV | |
| echo "REF=${GITHUB_SHA::6}" >> $GITHUB_ENV | |
| echo "Building for $NAME" | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.24' | |
| check-latest: true | |
| - name: Build warpscanner binary | |
| run: | | |
| mkdir -p warpscanner_${{ env.ASSET_NAME }} | |
| BINARY_NAME=warpscanner | |
| [[ "$GOOS" == "windows" ]] && BINARY_NAME+=".exe" | |
| go build -v -o warpscanner_${{ env.ASSET_NAME }}/$BINARY_NAME -trimpath -ldflags "-s -w -buildid= -X main.version=${{ github.ref }}" ./example/warpscanner | |
| - name: Copy README.md & LICENSE | |
| run: | | |
| cp README.md warpscanner_${{ env.ASSET_NAME }}/README.md || true | |
| cp LICENSE warpscanner_${{ env.ASSET_NAME }}/LICENSE || true | |
| - name: Create ZIP archive | |
| run: | | |
| cd warpscanner_${{ env.ASSET_NAME }} | |
| touch -mt $(date +%Y01010000) * | |
| zip -9vr ../warpscanner_${{ env.ASSET_NAME }}.zip . | |
| cd .. | |
| for METHOD in md5 sha256 sha512; do | |
| openssl dgst -$METHOD warpscanner_${{ env.ASSET_NAME }}.zip | sed 's/([^)]*)//g' >> warpscanner_${{ env.ASSET_NAME }}.zip.dgst | |
| done | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: warpscanner_${{ env.ASSET_NAME }}_${{ env.REF }} | |
| path: | | |
| ./warpscanner_${{ env.ASSET_NAME }}/* | |
| - name: Upload release asset | |
| if: github.event_name == 'release' | |
| uses: svenstaro/upload-release-action@v2 | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: warpscanner_${{ env.ASSET_NAME }}.zip* | |
| tag: ${{ github.ref }} | |
| file_glob: true |