-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
370 additions
and
193 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
name: build_yan_for_windows | ||
on: | ||
push: | ||
branches: | ||
- "master" | ||
jobs: | ||
release-all: | ||
name: release | ||
needs: [build-win] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
# 读取json 文件的属性 | ||
- name: Read Properties | ||
id: version # step_id 在后面会用到 | ||
uses: ashley-taylor/[email protected] | ||
with: | ||
path: ./web_src/package.json # 文件路径 | ||
property: version # 相应的字段 | ||
- name: create release | ||
id: create_release | ||
uses: actions/create-release@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.TOKEN }} | ||
with: | ||
# 根据版本号打标签 | ||
tag_name: v${{steps.version.outputs.value}} | ||
release_name: Release v${{steps.version.outputs.value}} | ||
draft: false | ||
prerelease: false | ||
- uses: actions/download-artifact@v2 | ||
with: | ||
name: release | ||
- name: upload win | ||
id: upload-windows | ||
uses: actions/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./yan-win.zip | ||
asset_name: yan-win.zip | ||
asset_content_type: application/zip | ||
|
||
build-win: | ||
name: build for windows | ||
runs-on: windows-latest | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: install rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
|
||
- name: install node/npm | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14' | ||
- name: build | ||
# 编译后在根目录生成index.node | ||
run: | | ||
npm install -g yarn | ||
cd web_src | ||
yarn | ||
yarn run build | ||
npm uninstall -g yarn | ||
cd ../ | ||
cargo build --release | ||
- name: zip windows artifact | ||
run: | | ||
powershell Compress-Archive ./target/release/yan.exe yan-win.zip | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: release | ||
path: ./yan-win.zip |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
web/ | ||
target/ | ||
target/ | ||
yan.exe |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.