mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-14 15:00:01 -04:00
add publish step to github action workflow
This commit is contained in:
parent
e3302e8e14
commit
647ee6a78a
3 changed files with 50 additions and 2 deletions
47
.github/workflows/main.yml
vendored
47
.github/workflows/main.yml
vendored
|
@ -58,6 +58,7 @@ jobs:
|
||||||
path: |
|
path: |
|
||||||
dist/*.js
|
dist/*.js
|
||||||
dist/*.js.map
|
dist/*.js.map
|
||||||
|
dist/*.wasm
|
||||||
tests:
|
tests:
|
||||||
name: Run Scramjet Tests
|
name: Run Scramjet Tests
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
@ -123,6 +124,52 @@ jobs:
|
||||||
artifacts: "mercuryworkshop-scramjet-*.tgz"
|
artifacts: "mercuryworkshop-scramjet-*.tgz"
|
||||||
prerelease: true
|
prerelease: true
|
||||||
|
|
||||||
|
publish:
|
||||||
|
name: Publish Scramjet to NPM
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [build, tests]
|
||||||
|
if: false
|
||||||
|
permissions: write-all
|
||||||
|
steps:
|
||||||
|
- name: Setup Node.js
|
||||||
|
uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: "20"
|
||||||
|
registry-url: "https://registry.npmjs.org"
|
||||||
|
|
||||||
|
- name: Get artifacts
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: packaged-scramjet
|
||||||
|
path: .
|
||||||
|
|
||||||
|
- name: Extract package
|
||||||
|
run: tar xvf mercuryworkshop-scramjet-*.tgz package --strip-components=1
|
||||||
|
|
||||||
|
- name: Check the version
|
||||||
|
id: check
|
||||||
|
run: |
|
||||||
|
CURRENT_VERSION=$(jq -r .version package.json)
|
||||||
|
echo "Current version: $CURRENT_VERSION"
|
||||||
|
LATEST_VERSION=$(npm view @mercuryworkshop/scramjet version || echo "0.0.0")
|
||||||
|
echo "Latest NPM version: $LATEST_VERSION"
|
||||||
|
|
||||||
|
if [ "$LATEST_VERSION" != "$CURRENT_VERSION" ];
|
||||||
|
then
|
||||||
|
echo "Version changed"
|
||||||
|
echo "version_changed=true" >> $GITHUB_OUTPUT
|
||||||
|
echo "new_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "Version not changed"
|
||||||
|
echo "version_changed=false" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Publish
|
||||||
|
if: steps.check.outputs.version_changed == 'true'
|
||||||
|
run: npm publish --access public --no-git-checks
|
||||||
|
env:
|
||||||
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
|
|
||||||
pages:
|
pages:
|
||||||
name: Upload to Github Pages
|
name: Upload to Github Pages
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
"files": [
|
"files": [
|
||||||
"dist/*.js",
|
"dist/*.js",
|
||||||
"dist/*.js.map",
|
"dist/*.js.map",
|
||||||
|
"dist/*.wasm",
|
||||||
"lib"
|
"lib"
|
||||||
],
|
],
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
|
|
|
@ -13,11 +13,11 @@ export default defineConfig({
|
||||||
? [
|
? [
|
||||||
[
|
[
|
||||||
"@estruyf/github-actions-reporter",
|
"@estruyf/github-actions-reporter",
|
||||||
<GitHubActionOptions>{
|
{
|
||||||
title: "Test summary",
|
title: "Test summary",
|
||||||
useDetails: true,
|
useDetails: true,
|
||||||
showError: true,
|
showError: true,
|
||||||
},
|
} as GitHubActionOptions,
|
||||||
],
|
],
|
||||||
["github"],
|
["github"],
|
||||||
]
|
]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue