Skip to content

release/0.8.8

release/0.8.8 #48

Workflow file for this run

name: Release GoByPASS403
on:
push:
tags:
- 'v*'
jobs:
build-linux:
name: Build Static Linux Binary
runs-on: ubuntu-latest
container:
image: alpine:3.22
steps:
- name: Install dependencies
run: apk add --no-cache build-base git curl pkgconf sqlite-dev musl-dev
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.24.1
- name: Checkout
uses: actions/checkout@v3
- name: Configure Git Safe Directory
run: git config --global --add safe.directory /__w/gobypass403/gobypass403
- name: Extract version from Git tag
run: |
VERSION=$(git describe --tags --abbrev=0 | sed 's/^v//')
echo "VERSION=$VERSION" >> $GITHUB_ENV
shell: sh
- name: Build Static Linux Binary (CGO + musl)
env:
CGO_ENABLED: 1
GOOS: linux
GOARCH: amd64
run: |
mkdir -p dist
go build -v -a -ldflags "-X github.com/slicingmelon/gobypass403/core/cli.GOBYPASS403_VERSION=${VERSION} -s -w -extldflags '-static'" \
-o dist/gobypass403_${VERSION}_linux_amd64 ./cmd/gobypass403
- name: Upload Linux artifacts
uses: actions/upload-artifact@v4
with:
name: gobypass403-binary-linux-amd64
path: dist/*
build-other:
name: Build macOS & Windows
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: macos-latest
goos: darwin
goarch: amd64
- os: windows-latest
goos: windows
goarch: amd64
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Extract version from Git tag
run: |
VERSION=$(git describe --tags --abbrev=0 | sed 's/^v//')
echo "VERSION=$VERSION" >> $GITHUB_ENV
shell: bash
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.24.1
- name: Build macOS & Windows binaries
shell: bash
env:
CGO_ENABLED: 1
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
run: |
mkdir -p dist
EXT=""
if [ "${{ matrix.goos }}" = "windows" ]; then
EXT=".exe"
fi
OUTPUT_NAME="dist/gobypass403_${VERSION}_${{ matrix.goos }}_${{ matrix.goarch }}${EXT}"
LDFLAGS="-X github.com/slicingmelon/gobypass403/core/cli.GOBYPASS403_VERSION=${VERSION} -s -w"
if [ "${{ matrix.goos }}" = "windows" ]; then
go build -v -a -ldflags "${LDFLAGS}" -o ${OUTPUT_NAME} ./cmd/gobypass403
else
go build -v -ldflags "${LDFLAGS}" -o ${OUTPUT_NAME} ./cmd/gobypass403
fi
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: gobypass403-binary-${{ matrix.goos }}-${{ matrix.goarch }}
path: dist/*
# Create single release with all binaries
release:
name: Create Release
needs: [build-linux, build-other]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: dist
pattern: gobypass403-binary-*
merge-multiple: true
- name: Extract changelog for current version
id: changelog
run: |
if [ -f CHANGELOG.md ]; then
BODY=$(awk 'NR > 1 && /^#/ {exit} NR > 1 {print}' CHANGELOG.md)
echo 'body<<EOF' >> "$GITHUB_OUTPUT"
echo "$BODY" >> "$GITHUB_OUTPUT"
echo 'EOF' >> "$GITHUB_OUTPUT"
else
echo "body=Release for ${{ github.ref_name }}" >> "$GITHUB_OUTPUT"
fi
- name: Create Draft Release
uses: softprops/action-gh-release@v1
with:
files: dist/*
draft: true
body: ${{ steps.changelog.outputs.body }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}