使用最新的mihomo程序更新核心文件 #236
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: | |
# schedule: | |
# # * is a special character in YAML so you have to quote this string | |
# - cron: "0 0 * * *" | |
on: [push] | |
jobs: | |
release: | |
name: Release | |
runs-on: macOS-latest | |
steps: | |
- name: init | |
uses: actions/checkout@v1 | |
- name: get sha | |
id: sha | |
shell: bash | |
run: echo "::set-output name=value::$(cat sha.txt)" | |
- name: clone | |
env: | |
sha: ${{steps.sha.outputs.value}} | |
run: | | |
ls -alF | |
rm -rf * | |
rm -rf .git | |
rm -rf .github | |
ls -alF | |
git clone ${{secrets.GIT_ADDRESS}} . | |
git checkout $sha | |
shell: bash | |
- name: get package | |
id: package | |
uses: Ireoo/get-package@v1 | |
with: | |
path: package.json | |
key: version | |
- name: get update | |
id: update | |
shell: bash | |
run: echo "::set-output name=value::$(cat update.md)" | |
- name: create release | |
id: release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
with: | |
tag_name: v${{steps.package.outputs.version}} | |
release_name: Clashr Auto Test v${{steps.package.outputs.version}} | |
body: ${{github.event.head_commit.message}} | |
draft: false | |
prerelease: false | |
- name: init cache | |
env: | |
git_cache: ${{secrets.GIT_CACHE}} | |
upload_url: ${{steps.release.outputs.upload_url}} | |
github_sha: ${{github.sha}} | |
run: | | |
git config --global user.email "clashr.auto@gmail.com" | |
git config --global user.name "Clashr Auto" | |
git clone $git_cache cache | |
cd cache | |
echo "$upload_url" > $github_sha.txt | |
git add $github_sha.txt | |
git commit -m "$github_sha" | |
git push | |
build: | |
needs: [release] | |
runs-on: ${{matrix.os}} | |
strategy: | |
fail-fast: false | |
matrix: | |
node: [16] | |
os: [ubuntu-latest, macOS-latest, windows-latest] | |
steps: | |
- name: init | |
uses: actions/checkout@master | |
- name: get sha | |
id: sha | |
shell: bash | |
run: echo "::set-output name=value::$(cat sha.txt)" | |
- name: clone | |
env: | |
sha: ${{steps.sha.outputs.value}} | |
run: | | |
ls -alF | |
rm -rf * | |
rm -rf .git | |
rm -rf .github | |
ls -alF | |
git clone ${{secrets.GIT_ADDRESS}} . | |
git checkout $sha | |
shell: bash | |
- name: set go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: 1.14.2 | |
check-latest: true | |
- name: set GO111MODULE | |
run: | | |
go help env | |
go env -w GO111MODULE="on" | |
go env | |
shell: bash | |
- name: set node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ matrix.node }} | |
- name: install | |
run: npm i | |
shell: bash | |
- name: npm run init | |
run: npm run init | |
shell: bash | |
- name: npm run build | |
run: npm run build | |
shell: bash | |
- name: get package version | |
id: package | |
uses: Ireoo/get-package@v1 | |
with: | |
path: ./package.json | |
key: version | |
- name: get package productName | |
id: package1 | |
uses: Ireoo/get-package@v1 | |
with: | |
path: package.json | |
key: productName | |
- name: init cache | |
id: cache | |
shell: bash | |
env: | |
git_cache: ${{secrets.GIT_CACHE}} | |
github_sha: ${{github.sha}} | |
run: | | |
git clone $git_cache cache | |
cd cache | |
echo "::set-output name=upload_url::$(cat $github_sha.txt)" | |
- name: Upload Release | |
uses: Ireoo/upload-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.cache.outputs.upload_url }} | |
dir: build | |
exts: '["exe", "dmg", "zip", "appimage", "deb", "rpm", "apk", "msi", "pkg", "appx"]' | |
suffix: "" |