add PROCESS-NAME-REGEX
and PROCESS-PATH-REGEX
#622
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: 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.22" | |
# modify from https://github.com/restic/restic/issues/4636#issuecomment-1896455557 | |
# this patch file only works on golang1.22.x | |
# that means after golang1.23 release it must be changed | |
- name: Revert Golang1.22 commit for Windows7/8 | |
run: | | |
cd $(go env GOROOT) | |
patch --verbose -R -p 1 < $GITHUB_WORKSPACE/.github/693def151adff1af707d82d28f55dba81ceb08e1.diff | |
- 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 |