Skip to content

fix test

fix test #641

Workflow file for this run

name: Release
on: [push]
jobs:
build:
permissions: write-all
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
job:
- { target: "linux-386 linux-amd64 linux-amd64-v3", id: "1" }
- { target: "linux-armv5 linux-armv6 linux-armv7", id: "2" }
- { target: "linux-arm64 linux-mips64 linux-mips64le", id: "3" }
- { target: "linux-mips-softfloat linux-mips-hardfloat linux-mipsle-softfloat linux-mipsle-hardfloat", id: "4" }
- { target: "freebsd-386 freebsd-amd64 freebsd-amd64-v3 freebsd-arm64", id: "5" }
- { target: "windows-amd64 windows-amd64-v3 windows-386", id: "6" }
- { target: "windows-arm64 windows-armv7", id: "7" }
- { target: "darwin-amd64 darwin-amd64-v3 darwin-arm64", id: "8" }
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
check-latest: true
go-version: "1.23"
# modify from https://github.com/restic/restic/issues/4636#issuecomment-1896455557
# this patch file only works on golang1.23.x
# that means after golang1.24 release it must be changed
# see: https://github.com/MetaCubeX/go/commits/release-branch.go1.23/
# revert:
# 693def151adff1af707d82d28f55dba81ceb08e1: "crypto/rand,runtime: switch RtlGenRandom for ProcessPrng"
# 7c1157f9544922e96945196b47b95664b1e39108: "net: remove sysSocket fallback for Windows 7"
# 48042aa09c2f878c4faa576948b07fe625c4707a: "syscall: remove Windows 7 console handle workaround"
# a17d959debdb04cd550016a3501dd09d50cd62e7: "runtime: always use LoadLibraryEx to load system libraries"
- name: Revert Golang1.23 commit for Windows7/8
run: |
cd $(go env GOROOT)
curl https://github.com/MetaCubeX/go/commit/9ac42137ef6730e8b7daca016ece831297a1d75b.diff | patch --verbose -p 1
curl https://github.com/MetaCubeX/go/commit/21290de8a4c91408de7c2b5b68757b1e90af49dd.diff | patch --verbose -p 1
curl https://github.com/MetaCubeX/go/commit/6a31d3fa8e47ddabc10bd97bff10d9a85f4cfb76.diff | patch --verbose -p 1
curl https://github.com/MetaCubeX/go/commit/69e2eed6dd0f6d815ebf15797761c13f31213dd6.diff | patch --verbose -p 1
- name: Set variables
run: echo "VERSION=$(git describe --tags)" >> $GITHUB_ENV
shell: bash
- name: Set ENV
run: |
echo "GOTOOLCHAIN=local" >> $GITHUB_ENV
shell: bash
- name: Get dependencies, run test
if: ${{ matrix.job.id=='1' }}
run: |
go test ./...
- name: Update CA
run: |
sudo apt-get install ca-certificates
sudo update-ca-certificates
cp -f /etc/ssl/certs/ca-certificates.crt component/ca/ca-certificates.crt
- name: Update Country.mmdb
run: |
cd component/mmdb
rm Country.mmdb
wget -O Country.mmdb https://raw.githubusercontent.com/Loyalsoldier/geoip/release/Country-only-cn-private.mmdb
# wget -O Country.mmdb https://raw.githubusercontent.com/JMVoid/ipip2mmdb/release/Country.mmdb
- name: Build
# if: startsWith(github.ref, 'refs/tags/')
env:
NAME: mihomo
BINDIR: bin
run: |
make -j$(($(nproc) + 1)) ${{ matrix.job.target }}
cd bin
ls -la
chmod +x *
cp ../.github/release.sh ./
bash ./release.sh
rm ./release.sh
ls -la
cd ..
- name: Update Artifact
uses: actions/upload-artifact@v3
with:
name: bin
path: bin/
- name: Upload Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: bin/*
draft: true