Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix ci build without secrets #311

Merged
merged 13 commits into from
Dec 25, 2024
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
50 changes: 33 additions & 17 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,36 +61,44 @@ jobs:
- name: Read version from package.json
run: echo "VERSION=$(npm pkg get version | tr -d '\"')" >> $GITHUB_ENV

- name: chrome ext upload
run: |
npx cws-upload ${{ secrets.CLIENT_ID }} ${{ secrets.CLIENT_SECRET }} ${{ secrets.REFRESH_TOKEN }} ./build/jiffyReader-chrome-prod.zip ${{ secrets.EXTENSION_ID }}

# if secrete.DEV_EXTENSION_ID is not empty then publish
if [ -n "${{ secrets.EXTENSION_DEV_ID }}" ]; then
npx cws-upload ${{ secrets.CLIENT_ID }} ${{ secrets.CLIENT_SECRET }} ${{ secrets.REFRESH_TOKEN }} ./build/jiffyReader-chrome-dev.zip ${{ secrets.EXTENSION_DEV_ID }}
fi

# - name: WebExtPublish: Firefox
# uses: maoserr/firefox_extension_publish@v1.0.4
# with:
# firefox_extension_id: ${{ secrets.FIREFOX_DEV_EXT_ID }}
# api_key: ${{ secrets.FIREFOX_API_KEY }}
# api_secret: ${{ secrets.FIREFOX_API_SECRET }}
# file: build/jiffyReader-firefox-dev.xpi


- uses: ncipollo/release-action@v1
with:
# artifacts: "dist/wyzant-looker.zip,dist/changelog.md,CHANGELOG.md"
allowUpdates: true
artifacts: "build/jiffyReader*"
token: ${{ secrets.GITHUB_TOKEN }}
generateReleaseNotes: true
prerelease: true
tag: ${{ env.VERSION }}

- name: push master tags
run: git push --follow-tags origin HEAD
run: git push --follow-tags origin HEAD -f


- name: chrome ext upload
run: |
if [ -z "${{ secrets.CLIENT_ID }}" ] || [ -z "${{ secrets.CLIENT_SECRET }}" ] || [ -z "${{ secrets.REFRESH_TOKEN }}" ] || [ -z "${{ secrets.EXTENSION_ID }}" ]; then
echo "Required secrets are not provided. Exiting."
exit 0
fi

npx cws-upload ${{ secrets.CLIENT_ID }} ${{ secrets.CLIENT_SECRET }} ${{ secrets.REFRESH_TOKEN }} ./build/jiffyReader-chrome-prod.zip ${{ secrets.EXTENSION_ID }}

# if secrete.DEV_EXTENSION_ID is not empty then publish
if [ -n "${{ secrets.EXTENSION_DEV_ID }}" ]; then
npx cws-upload ${{ secrets.CLIENT_ID }} ${{ secrets.CLIENT_SECRET }} ${{ secrets.REFRESH_TOKEN }} ./build/jiffyReader-chrome-dev.zip ${{ secrets.EXTENSION_DEV_ID }}
fi


- name: chrome ext publish
run: |
if [ -z "${{ secrets.CLIENT_ID }}" ] || [ -z "${{ secrets.CLIENT_SECRET }}" ] || [ -z "${{ secrets.REFRESH_TOKEN }}" ] || [ -z "${{ secrets.EXTENSION_ID }}" ]; then
echo "Required secrets are not provided. Exiting."
exit 0
fi

npx cws-publish ${{ secrets.CLIENT_ID }} ${{ secrets.CLIENT_SECRET }} ${{ secrets.REFRESH_TOKEN }} ./build/jiffyReader-chrome-prod.zip ${{ secrets.EXTENSION_ID }}

# if secrete.DEV_EXTENSION_ID is not empty then publish
Expand All @@ -99,3 +107,11 @@ jobs:
fi



# - name: WebExtPublish: Firefox
# uses: maoserr/firefox_extension_publish@v1.0.4
# with:
# firefox_extension_id: ${{ secrets.FIREFOX_DEV_EXT_ID }}
# api_key: ${{ secrets.FIREFOX_API_KEY }}
# api_secret: ${{ secrets.FIREFOX_API_SECRET }}
# file: build/jiffyReader-firefox-dev.xpi
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.

## [1.2.6](https://github.com/ansh/jiffyreader.com/compare/v1.2.5...v1.2.6) (2024-12-25)

## [1.2.5](https://github.com/ansh/jiffyreader.com/compare/v1.2.4...v1.2.5) (2024-12-25)


### Bug Fixes

* **build:** set different name for dev builds ([d1f7b22](https://github.com/ansh/jiffyreader.com/commit/d1f7b22c9ae897c9fe9cb01f98a57ee3e654af82))
* **ci:** attempt to upload to cws when secrets available ([03bef78](https://github.com/ansh/jiffyreader.com/commit/03bef7811edcbe51ad5f506e01bfaf837cf4eb98))
* **ci:** build and publish tags as prelease, requires manually unchecking a prerelease to mark it as current in gh gui ([08d2fa1](https://github.com/ansh/jiffyreader.com/commit/08d2fa1d2674bf8948e1bc74dd55e4aac29ee1cf))
* **ci:** check to run cws uploads with scripts ([921b2fe](https://github.com/ansh/jiffyreader.com/commit/921b2fe298293fa1fcd16398ad142819a366f281))

## [1.2.4](https://github.com/ansh/jiffyreader.com/compare/v1.2.3...v1.2.4) (2024-12-25)


Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "jiffy-reader",
"displayName": "Jiffy reader",
"version": "1.2.4",
"version": "1.2.6",
"description": "jiffy reader",
"packageManager": "yarn@1.22.19",
"scripts": {
Expand All @@ -20,7 +20,7 @@
"gh:build:firefox": "TARGET=firefox SHORTCUT=\"Alt+W\" MANIFEST_VERSION=firefox-mv2 npm run buildx && npm run bundle:firefox",
"gh:build:safari": "TARGET=safari SHORTCUT=\"Alt+W\" MANIFEST_VERSION=safari-mv2 npm run buildx && npm run bundle:safari",
"gh:build": "echo 'TAG=prod NODE_ENV=production npm run gh:build:' | xargs -I{} bash -c '{}opera && {}chrome & {}firefox & {}safari'",
"gh:build:development": "echo 'TAG=dev NODE_ENV=development npm run gh:build:' | xargs -I{} bash -c '{}opera && {}chrome & {}firefox & {}safari'",
"gh:build:development": "echo 'TAG=dev NODE_ENV=development NAME=Jiffy-Reader-Dev npm run gh:build:' | xargs -I{} sh -c '{}opera && {}chrome & {}firefox & {}safari'",
"gh:build:bookmarklet": "VERSION=\"$(npm pkg get version | tr -d '\"')\" node src/Bookmarklet/esbuild.mjs",
"bundle": "npm run bundle:chrome & npm run bundle:firefix & npm run bundle:safari",
"bundle:firefox": "cd build/firefox-mv2-prod/ && zip -r ../jiffyReader-firefox-$TAG.xpi ./*",
Expand All @@ -36,7 +36,7 @@
"dependencies": {
"@plasmohq/prettier-plugin-sort-imports": "^1.1.1",
"@plasmohq/storage": "^0.8.1",
"axios": "^1.6.5",
"axios": "^1.7.4",
"commit-and-tag-version": "^12.5.0",
"cross-env": "^7.0.3",
"esbuild": "^0.14.53",
Expand Down
6 changes: 5 additions & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading