docs: refresh release screenshots #17
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: Release | |
| on: | |
| push: | |
| tags: ["v*"] | |
| permissions: | |
| contents: write | |
| jobs: | |
| frontend: | |
| name: Build Frontend | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-node@v5 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| cache-dependency-path: web/package-lock.json | |
| - run: cd web && npm ci && npm run build | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: frontend-dist | |
| path: web/dist/ | |
| build: | |
| name: Build ${{ matrix.goos }}/${{ matrix.goarch }} | |
| needs: frontend | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| goos: linux | |
| goarch: amd64 | |
| - os: ubuntu-latest | |
| goos: linux | |
| goarch: arm64 | |
| - os: macos-latest | |
| goos: darwin | |
| goarch: amd64 | |
| - os: macos-latest | |
| goos: darwin | |
| goarch: arm64 | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-go@v6 | |
| with: | |
| go-version: "1.22" | |
| cache: true | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: frontend-dist | |
| path: web/dist/ | |
| - name: Embed frontend | |
| run: | | |
| rm -rf cmd/opensnitch-web/frontend | |
| cp -r web/dist cmd/opensnitch-web/frontend | |
| - name: Install cross-compiler | |
| if: matrix.goos == 'linux' && matrix.goarch == 'arm64' | |
| run: sudo apt-get update && sudo apt-get install -y gcc-aarch64-linux-gnu | |
| - name: Build binary | |
| env: | |
| GOOS: ${{ matrix.goos }} | |
| GOARCH: ${{ matrix.goarch }} | |
| CGO_ENABLED: "1" | |
| run: | | |
| if [ "${{ matrix.goos }}" = "linux" ] && [ "${{ matrix.goarch }}" = "arm64" ]; then | |
| export CC=aarch64-linux-gnu-gcc | |
| fi | |
| VERSION=${GITHUB_REF_NAME} | |
| BUILD_TIME=$(date -u '+%Y-%m-%dT%H:%M:%SZ') | |
| LDFLAGS="-X github.com/evilsocket/opensnitch-web/internal/version.Version=${VERSION} -X github.com/evilsocket/opensnitch-web/internal/version.BuildTime=${BUILD_TIME}" | |
| go build -ldflags "${LDFLAGS}" -o opensnitch-web-${{ matrix.goos }}-${{ matrix.goarch }} ./cmd/opensnitch-web | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: binary-${{ matrix.goos }}-${{ matrix.goarch }} | |
| path: opensnitch-web-${{ matrix.goos }}-${{ matrix.goarch }} | |
| release: | |
| name: Create Release | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| pattern: binary-* | |
| merge-multiple: true | |
| - name: Generate checksums | |
| run: sha256sum opensnitch-web-* > checksums.txt | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| prerelease: ${{ contains(github.ref_name, '-beta') || contains(github.ref_name, '-alpha') || contains(github.ref_name, '-rc') }} | |
| generate_release_notes: true | |
| files: | | |
| opensnitch-web-* | |
| checksums.txt |