chore(deps): bump golang.org/x/crypto from 0.29.0 to 0.31.0 #220
This file contains 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: Test and Release | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
paths: | |
- "**/*.go" | |
- "go.mod" | |
- "go.sum" | |
- ".github/workflows/*.yml" | |
pull_request: | |
types: [ opened, synchronize, reopened ] | |
paths: | |
- "**/*.go" | |
- "go.mod" | |
- "go.sum" | |
- ".github/workflows/*.yml" | |
release: | |
types: [ published ] | |
jobs: | |
build: | |
strategy: | |
matrix: | |
build-tag: [ 'none' ] | |
goos: [ linux ] | |
goarch: [ amd64 ] | |
goamd64: [ v1, v3 ] | |
include: | |
- build-tag: none | |
goos: linux | |
goarch: arm64 | |
- build-tag: none | |
goos: linux | |
goarch: riscv64 | |
fail-fast: false | |
runs-on: ubuntu-latest | |
env: | |
BUILD_TAG: ${{ matrix.build-tag }} | |
GOOS: ${{ matrix.goos }} | |
GOARCH: ${{ matrix.goarch }} | |
GOAMD64: ${{ matrix.goamd64 }} | |
CGO_ENABLED: 0 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Generate build information | |
id: get_filename | |
run: | | |
echo "BUILD_TAG: $BUILD_TAG, GOOS: $GOOS, GOARCH: $GOARCH, GOAMD64: $GOAMD64" | |
if [ "$GOAMD64" == "v3" ]; then | |
if [ "$BUILD_TAG" == "none" ]; then | |
echo "ASSET_NAME=$GOOS-$GOARCH$GOAMD64" >> $GITHUB_OUTPUT | |
echo "ASSET_NAME=$GOOS-$GOARCH$GOAMD64" >> $GITHUB_ENV | |
else | |
echo "ASSET_NAME=$GOOS-$GOARCH$GOAMD64-$BUILD_TAG" >> $GITHUB_OUTPUT | |
echo "ASSET_NAME=$GOOS-$GOARCH$GOAMD64-$BUILD_TAG" >> $GITHUB_ENV | |
fi | |
else | |
if [ "$BUILD_TAG" == "none" ]; then | |
echo "ASSET_NAME=$GOOS-$GOARCH" >> $GITHUB_OUTPUT | |
echo "ASSET_NAME=$GOOS-$GOARCH" >> $GITHUB_ENV | |
else | |
echo "ASSET_NAME=$GOOS-$GOARCH-$BUILD_TAG" >> $GITHUB_OUTPUT | |
echo "ASSET_NAME=$GOOS-$GOARCH-$BUILD_TAG" >> $GITHUB_ENV | |
fi | |
fi | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ^1.23 | |
- name: Get project dependencies | |
run: go mod download | |
- name: Build next-server | |
run: | | |
mkdir -p build_assets | |
if [ $BUILD_TAG != "none" ]; then | |
go build -v -o build_assets/next-server -trimpath -ldflags "-s -w -buildid=" -tags $BUILD_TAG | |
else | |
go build -v -o build_assets/next-server -trimpath -ldflags "-s -w -buildid=" | |
fi | |
- name: Prepare config files | |
run: | | |
cp ${GITHUB_WORKSPACE}/README.md ./build_assets/README.md | |
cp ${GITHUB_WORKSPACE}/LICENSE ./build_assets/LICENSE | |
cp ${GITHUB_WORKSPACE}/release/config/dns.json ./build_assets/dns.json | |
cp ${GITHUB_WORKSPACE}/release/config/route.json ./build_assets/route.json | |
cp ${GITHUB_WORKSPACE}/release/config/custom_outbound.json ./build_assets/custom_outbound.json | |
cp ${GITHUB_WORKSPACE}/release/config/custom_inbound.json ./build_assets/custom_inbound.json | |
cp ${GITHUB_WORKSPACE}/release/config/rulelist ./build_assets/rulelist | |
cp ${GITHUB_WORKSPACE}/release/config/config.yml.example ./build_assets/config.yml | |
wget -O ./build_assets/geoip.dat https://raw.githubusercontent.com/v2fly/geoip/release/geoip.dat | |
wget -O ./build_assets/geosite.dat https://raw.githubusercontent.com/v2fly/domain-list-community/release/dlc.dat | |
- name: Create zip archive | |
run: | | |
pushd build_assets || exit 1 | |
zip -9vr ../next-server-$ASSET_NAME.zip . | |
popd || exit 1 | |
FILE=./next-server-$ASSET_NAME.zip | |
DGST=$FILE.hash.txt | |
openssl dgst -sha256 $FILE | sed 's/([^)]*)//g' >>$DGST | |
openssl dgst -sha3-256 $FILE | sed 's/([^)]*)//g' >>$DGST | |
mv build_assets next-server-$ASSET_NAME | |
- name: Upload files to artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: next-server-${{ steps.get_filename.outputs.ASSET_NAME }} | |
path: | | |
./next-server-${{ steps.get_filename.outputs.ASSET_NAME }}/* | |
- name: Upload files to release | |
uses: svenstaro/upload-release-action@v2 | |
if: ${{ github.event_name == 'release' }} | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: ./next-server-${{ steps.get_filename.outputs.ASSET_NAME }}.zip* | |
tag: ${{ github.ref }} | |
file_glob: true |