2024-08-15 04:22:07 +00:00
|
|
|
name: Release drafter
|
|
|
|
|
|
|
|
on: workflow_dispatch
|
|
|
|
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
draft_release:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
|
|
tag_name: ${{ steps.release.outputs.tag_name }}
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
pull-requests: write
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Read version
|
|
|
|
id: read_version
|
|
|
|
run: |
|
|
|
|
echo "version=$(cat version/VERSION | tr -d '[:space:]')" >> $GITHUB_OUTPUT
|
|
|
|
- name: Print version
|
|
|
|
run: |
|
|
|
|
echo ${{ steps.read_version.outputs.version }}
|
|
|
|
- uses: release-drafter/release-drafter@v6
|
|
|
|
id: release
|
|
|
|
with:
|
|
|
|
name: ${{ steps.read_version.outputs.version }}
|
|
|
|
version: ${{ steps.read_version.outputs.version }}
|
|
|
|
tag: ${{ steps.read_version.outputs.version }}
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
|
|
|
build_and_publish:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: draft_release
|
|
|
|
name: Release linux/amd64
|
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
pull-requests: write
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
TAG_NAME: ${{ needs.draft_release.outputs.tag_name }}
|
2024-08-20 16:42:47 +00:00
|
|
|
CGO_ENABLED: 0
|
2024-08-15 04:22:07 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Go
|
|
|
|
uses: actions/setup-go@v5
|
|
|
|
with:
|
|
|
|
go-version: 1.21
|
|
|
|
- name: Display Go version
|
|
|
|
run: go version
|
|
|
|
|
|
|
|
- name: darwin/amd64
|
|
|
|
env:
|
|
|
|
GOOS: darwin
|
|
|
|
GOARCH: amd64
|
|
|
|
run: |
|
2024-08-27 03:15:10 +00:00
|
|
|
go build -ldflags="-w -s" github.com/xvzc/SpoofDPI/cmd/spoofdpi
|
|
|
|
tar -zcvf "spoofdpi-$GOOS-$GOARCH.tar.gz" ./spoofdpi && rm -rf ./spoofdpi
|
|
|
|
gh release upload $TAG_NAME "./spoofdpi-$GOOS-$GOARCH.tar.gz"
|
2024-08-15 04:22:07 +00:00
|
|
|
|
|
|
|
- name: darwin/arm64
|
|
|
|
env:
|
|
|
|
GOOS: darwin
|
|
|
|
GOARCH: arm64
|
|
|
|
run: |
|
2024-08-27 03:15:10 +00:00
|
|
|
go build -ldflags="-w -s" github.com/xvzc/SpoofDPI/cmd/spoofdpi
|
|
|
|
tar -zcvf "spoofdpi-$GOOS-$GOARCH.tar.gz" ./spoofdpi && rm -rf ./spoofdpi
|
|
|
|
gh release upload $TAG_NAME "./spoofdpi-$GOOS-$GOARCH.tar.gz"
|
2024-08-15 04:22:07 +00:00
|
|
|
|
|
|
|
- name: linux/amd64
|
|
|
|
env:
|
|
|
|
GOOS: linux
|
|
|
|
GOARCH: amd64
|
|
|
|
run: |
|
2024-08-27 03:15:10 +00:00
|
|
|
go build -ldflags="-w -s" github.com/xvzc/SpoofDPI/cmd/spoofdpi
|
|
|
|
tar -zcvf "spoofdpi-$GOOS-$GOARCH.tar.gz" ./spoofdpi && rm -rf ./spoofdpi
|
|
|
|
gh release upload $TAG_NAME "./spoofdpi-$GOOS-$GOARCH.tar.gz"
|
2024-08-15 04:22:07 +00:00
|
|
|
|
|
|
|
- name: linux/arm
|
|
|
|
env:
|
|
|
|
GOOS: linux
|
|
|
|
GOARCH: arm
|
|
|
|
run: |
|
2024-08-27 03:15:10 +00:00
|
|
|
go build -ldflags="-w -s" github.com/xvzc/SpoofDPI/cmd/spoofdpi
|
|
|
|
tar -zcvf "spoofdpi-$GOOS-$GOARCH.tar.gz" ./spoofdpi && rm -rf ./spoofdpi
|
|
|
|
gh release upload $TAG_NAME "./spoofdpi-$GOOS-$GOARCH.tar.gz"
|
2024-08-15 04:22:07 +00:00
|
|
|
|
|
|
|
- name: linux/arm64
|
|
|
|
env:
|
|
|
|
GOOS: linux
|
|
|
|
GOARCH: arm64
|
|
|
|
run: |
|
2024-08-27 03:15:10 +00:00
|
|
|
go build -ldflags="-w -s" github.com/xvzc/SpoofDPI/cmd/spoofdpi
|
|
|
|
tar -zcvf "spoofdpi-$GOOS-$GOARCH.tar.gz" ./spoofdpi && rm -rf ./spoofdpi
|
|
|
|
gh release upload $TAG_NAME "./spoofdpi-$GOOS-$GOARCH.tar.gz"
|
2024-08-15 04:22:07 +00:00
|
|
|
|
|
|
|
- name: linux/mips
|
|
|
|
env:
|
|
|
|
GOOS: linux
|
|
|
|
GOARCH: mips
|
|
|
|
run: |
|
2024-08-27 03:15:10 +00:00
|
|
|
go build -ldflags="-w -s" github.com/xvzc/SpoofDPI/cmd/spoofdpi
|
|
|
|
tar -zcvf "spoofdpi-$GOOS-$GOARCH.tar.gz" ./spoofdpi && rm -rf ./spoofdpi
|
|
|
|
gh release upload $TAG_NAME "./spoofdpi-$GOOS-$GOARCH.tar.gz"
|
2024-08-15 04:22:07 +00:00
|
|
|
|
|
|
|
- name: linux/mipsle
|
|
|
|
env:
|
|
|
|
GOOS: linux
|
|
|
|
GOARCH: mipsle
|
|
|
|
run: |
|
2024-08-27 03:15:10 +00:00
|
|
|
go build -ldflags="-w -s" github.com/xvzc/SpoofDPI/cmd/spoofdpi
|
|
|
|
tar -zcvf "spoofdpi-$GOOS-$GOARCH.tar.gz" ./spoofdpi && rm -rf ./spoofdpi
|
|
|
|
gh release upload $TAG_NAME "./spoofdpi-$GOOS-$GOARCH.tar.gz"
|
2024-08-15 04:22:07 +00:00
|
|
|
|
|
|
|
- name: windows/amd64
|
|
|
|
env:
|
|
|
|
GOOS: windows
|
|
|
|
GOARCH: amd64
|
|
|
|
run: |
|
2024-08-27 03:15:10 +00:00
|
|
|
go build -ldflags="-w -s" -o "spoofdpi-$GOOS-$GOARCH.exe" github.com/xvzc/SpoofDPI/cmd/spoofdpi
|
|
|
|
gh release upload $TAG_NAME "./spoofdpi-$GOOS-$GOARCH.exe"
|
2024-08-15 04:22:07 +00:00
|
|
|
|