Skip to content

Commit

Permalink
Bump upload-artifact and download-artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
undergroundwires committed Dec 28, 2024
1 parent 05895cc commit 0ffe9f6
Showing 1 changed file with 27 additions and 15 deletions.
42 changes: 27 additions & 15 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,34 +49,46 @@ jobs:
needs: distribute
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
-
uses: actions/checkout@v4
with:
ref: master # Otherwise it defaults to the version tag missing bump commit
fetch-depth: 0 # Fetch all history
- name: Checkout to bump commit
-
name: Checkout to bump commit
run: git checkout "$(git rev-list "${{ github.event.release.tag_name }}"..master | tail -1)"
- run: |
mkdir "../artifact"
cp -r . "../artifact"
rm -rf "../artifact/.git"
rm -rf "../artifact/.github"
rm -rf "../artifact/node_modules"
- uses: actions/upload-artifact@v1
-
name: Create dist folder
run: |
mkdir "/tmp/package-dist"
cp -r . "/tmp/package-dist"
rm -rf "/tmp/package-dist/.git"
rm -rf "/tmp/package-dist/.github"
rm -rf "/tmp/package-dist/node_modules"
-
name: Upload dist folder
uses: actions/upload-artifact@v4
with:
name: package
path: ../artifact
name: npm-artifact
path: /tmp/package-dist

publish-package:
needs: create-package
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v4
-
uses: actions/setup-node@v4
with:
node-version: 22.x
registry-url: https://registry.npmjs.org/
- uses: actions/download-artifact@v1
-
name: Download npm artifact
uses: actions/download-artifact@v4
with:
name: package
- run: cd package && npm publish
name: npm-artifact
path: npm-dist
-
name: Publish npm package
run: cd npm-dist && npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

0 comments on commit 0ffe9f6

Please sign in to comment.