Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,19 @@ jobs:
publish-extension:
runs-on: ubuntu-latest
needs: js-test-and-release
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
if: needs.js-test-and-release.outputs.release == 'true'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version: lts/*
cache: npm
- run: npm ci
- uses: ipfs/aegir/actions/cache-node-modules@main
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks to this, we'll retrieve the build from cache. If, for some reason, cached build is not available, we'll run npm run build.

- run: npm run package
- run: npm run publish:chrome-store
env:
CHROME_CLIENT_ID: ${{ secrets.CHROME_CLIENT_ID }}
CHROME_CLIENT_SECRET: ${{ secrets.CHROME_CLIENT_SECRET }}
CHROME_REFRESH_TOKEN: ${{ secrets.CHROME_REFRESH_TOKEN }}
CHROME_EXTENSION_ID: ${{ vars.CHROME_EXTENSION_ID }}
CHROME_EXTENSION_ID: ${{ vars.CHROME_EXTENSION_ID }}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"scripts": {
"sync-version": "node scripts/sync-version.mjs",
"build": "npm run sync-version && tsc && cp src/manifest.json dist/ && cp src/popup.html dist/ && cp -r src/icons dist/",
"package": "npm run build && web-ext build --source-dir=dist --artifacts-dir=. --filename=ipfs-quicklaunch.zip --overwrite-dest",
"publish:chrome-store": "npx cws-publish $CHROME_CLIENT_ID $CHROME_CLIENT_SECRET $CHROME_REFRESH_TOKEN ipfs-quicklaunch.zip $CHROME_EXTENSION_ID",
"package": "web-ext build --source-dir=dist --artifacts-dir=. --filename=ipfs-quicklaunch.zip --overwrite-dest",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed build from here because we want to retrieve it from cache instead of running it during publishing.

"publish:chrome-store": "npx cws-publish \"$CHROME_CLIENT_ID\" \"$CHROME_CLIENT_SECRET\" \"$CHROME_REFRESH_TOKEN\" ipfs-quicklaunch.zip \"$CHROME_EXTENSION_ID\"",
"release": "aegir release",
"start": "npm run build && web-ext run --source-dir=dist --target=chromium",
"watch": "tsc --watch",
Expand Down
Loading