Update github action s upload method

This commit is contained in:
Tlntin
2023-03-24 14:17:20 +08:00
parent 6c150d8dac
commit c2151c5f5b
2 changed files with 21 additions and 17 deletions

View File

@@ -17,17 +17,14 @@ jobs:
os: ubuntu-20.04
rust: stable
target: x86_64-unknown-linux-musl
# archive-name: target-linux.tar.gz
- build: windows
os: windows-latest
rust: stable-x86_64-msvc
target: x86_64-pc-windows-msvc
# archive-name: target-windows.tar.gz
- build: macos
os: macos-latest
rust: stable
target: x86_64-apple-darwin
# archive-name: target-macos.tar.gz
fail-fast: false
steps:
@@ -81,10 +78,10 @@ jobs:
run: |
npm run build:all-windows
- name: Upload files
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
UPLOADTOOL_ISPRERELEASE: true
run: |
curl -L https://github.com/probonopd/uploadtool/raw/master/upload.sh --output upload.sh
bash upload.sh output/*/*.*
- name: Upload files (only for Windows)
uses: ncipollo/release-action@v1
if: matrix.target == 'x86_64-pc-windows-msvc'
with:
allowUpdates: true
artifacts: "output/*/*.*"
token: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -1,6 +1,11 @@
name: Build App with Cache
on:
workflow_dispatch: {}
workflow_dispatch:
inputs:
version:
description: "tag version"
required: true
default: "v0.0.1"
jobs:
build:
@@ -79,12 +84,14 @@ jobs:
npm run build:all-windows
- name: Upload files
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
UPLOADTOOL_ISPRERELEASE: true
run: |
curl -L https://github.com/probonopd/uploadtool/raw/master/upload.sh --output upload.sh
bash upload.sh output/*/*.*
# arg info: https://github.com/ncipollo/release-action#release-action
uses: ncipollo/release-action@v1
with:
allowUpdates: true
prerelease: true
artifacts: "output/*/*.*"
tag: ${{ inputs.version }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: rust cache store
uses: actions/cache/save@v3