Skip to content

Commit

Permalink
fix multi-platform artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
UlyssesZh committed Nov 10, 2024
1 parent 5947cd2 commit 0fe6bd4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
on:
push:
branches:
- master
branches: [master]
pull_request:
branches:
- master
branches: [master]

jobs:
generate:
Expand Down Expand Up @@ -36,7 +34,7 @@ jobs:
permissions: write-all
runs-on: ubuntu-latest
needs: generate

steps:
- name: Download (Ubuntu)
uses: actions/download-artifact@v4
Expand All @@ -48,11 +46,13 @@ jobs:
uses: actions/download-artifact@v4
with:
name: stats-windows-latest
path: grs

- name: Download (macOS)
uses: actions/download-artifact@v4
with:
name: stats-macos-latest
path: grs

- name: Push
uses: crazy-max/ghaction-github-pages@v4
Expand Down
12 changes: 9 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ inputs:
description: GitHub token; normally no need to set it
required: false
default: ${{ github.server_url == 'https://github.com' && github.token || '' }}
branding:
color: green
icon: bar-chart

runs:
using: composite
steps:
Expand All @@ -27,18 +31,23 @@ runs:
echo "lock=$(pwd)/package-lock.json" >> $GITHUB_OUTPUT
cd $GITHUB_WORKSPACE
shell: bash
# This step is needed because ${{ github.action_path }} has relative pathing (it ends with /./),
# which leads to an error in the setup-node step.

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: npm
cache-dependency-path: ${{ steps.lock.output.lock }}

- name: CI
run: |
cd $GITHUB_ACTION_PATH
npm ci
cd $GITHUB_WORKSPACE
shell: bash

- name: Run
run: node $GITHUB_ACTION_PATH/index.js
env:
Expand All @@ -47,6 +56,3 @@ runs:
GRS_PATH: ${{ inputs.path }}
PAT_1: ${{ inputs.token }}
shell: bash
branding:
color: green
icon: bar-chart

0 comments on commit 0fe6bd4

Please sign in to comment.