ci: fix "an artifact with this name already exists on the workflow run"

This commit is contained in:
shanmite 2024-04-25 09:05:16 +08:00
parent 5a86a0407a
commit df3e97d3bf
5 changed files with 12 additions and 12 deletions

View File

@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx

View File

@ -10,7 +10,7 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Mirror + trigger CI

View File

@ -12,7 +12,7 @@ jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}

View File

@ -30,16 +30,16 @@ jobs:
# nodev: 12
steps:
- name: "Checkout codes"
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: "Use Node.js"
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: "*"
- name: "Pkg this"
run: |
npm run pkg "node${{ matrix.nodev }}-${{ matrix.platform }}-x64"
- name: "Upload to artifact"
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: node${{ matrix.nodev }}-${{ matrix.platform }}-x64
path: "dist/*.zip"
@ -62,14 +62,14 @@ jobs:
- platform: alpine
steps:
- name: "Checkout codes"
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: "Pkg this"
run: |
npm run pkg "${{ matrix.platform }}-arm64"
npm run pkg "node18-${{ matrix.platform }}-arm64"
- name: "Upload to artifact"
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: arm64
name: node18-${{ matrix.platform }}-arm64
path: "dist/*.zip"
- name: "Upload to release draft"
uses: xresloader/upload-to-github-release@v1

View File

@ -28,12 +28,12 @@ mkdir -p $TARGET_DIR
npm install
if [[ "$1" == *"arm"* ]]; then
OUTFILE="$TARGET_DIR/lottery-auto-script-node18-$1"
OUTFILE="$TARGET_DIR/lottery-auto-script-$1"
sudo podman run --rm --privileged multiarch/qemu-user-static --reset -p yes
podman run -it \
--rm \
-v ${PWD}:/root/lottery \
shanmite/pkg-arm64 -t "node18.5.0-$1" -o "$OUTFILE" .
shanmite/pkg-arm64 -t "node18-$1" -o "$OUTFILE" .
elif [[ "$1" == *"x64"* ]]; then
OUTFILE="$TARGET_DIR/lottery-auto-script-$1"
npx pkg -t "$1" -o "$OUTFILE" .