Skip to content

Commit

Permalink
Update test.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Pake-Actions authored Mar 21, 2023
1 parent f77a8e3 commit 3804a59
Showing 1 changed file with 26 additions and 14 deletions.
40 changes: 26 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
name: Test App With Cache

on:
workflow_dispatch: {}
workflow_dispatch:
inputs:
version:
description: "tag version"
required: true
default: "v0.0.1"

jobs:
publish:
Expand Down Expand Up @@ -75,25 +80,32 @@ jobs:
command: build
args: --target ${{ matrix.target }} --release --locked

- name: Upload files (only for Mac/Linux)
- name: Rename files (only for Mac/Linux)
if: matrix.target != 'x86_64-pc-windows-msvc'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
UPLOADTOOL_ISPRERELEASE: true
VERSION: ${{ inputs.version }}
run: |
curl -L https://github.com/probonopd/uploadtool/raw/master/upload.sh --output upload.sh
mv target/${{ matrix.target }}/release/et et-${{ matrix.target }}
bash upload.sh et-${{ matrix.target }}
mkdir output/
mv target/${{ matrix.target }}/release/et et
tar -cavf output/et-${VERSION}-${{ matrix.target }}.tar.gz et CHANGELOG.md README.md LICENSE
- name: Upload files (only for Windows)
- name: Rename files (only for Windows)
if: matrix.target == 'x86_64-pc-windows-msvc'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
UPLOADTOOL_ISPRERELEASE: true
VERSION: ${{ inputs.version }}
run: |
curl -L https://github.com/probonopd/uploadtool/raw/master/upload.sh --output upload.sh
mv target/${{ matrix.target }}/release/et.exe et-${{ matrix.target }}.exe
bash upload.sh et-${{ matrix.target }}.exe
mkdir output/
mv target/${{ matrix.target }}/release/et.exe output/et-$env:VERSION-${{ matrix.target }}.exe
- name: Upload files
# 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
Expand All @@ -105,4 +117,4 @@ jobs:
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
key: ${{ runner.os }}-cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}

0 comments on commit 3804a59

Please sign in to comment.