Skip to content

Commit

Permalink
Add release workflow to allow publishing to stores automatically (#248)
Browse files Browse the repository at this point in the history
Co-authored-by: dani <29378233+DanielleMiu@users.noreply.github.com>
  • Loading branch information
kheina and kheina authored Apr 14, 2024
1 parent 1ae843d commit d6d2a62
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Publish Releases

on:
release:
types: [released]

jobs:
Release-FireFox:
runs-on: ubuntu-latest
outputs:
filename: ${{ steps.build.outputs.filename }}
steps:
- uses: actions/checkout@v4
- name: build firefox
id: build
run: |
make firefox
echo "filename=blue-blocker-firefox-$(make version).zip" >> "$GITHUB_OUTPUT"
- name: publish firefox
uses: wdzeng/firefox-addon@v1
with:
addon-guid: "{119be3f3-597c-4f6a-9caf-627ee431d374}"
xpi-path: "${{ steps.build.outputs.filename }}"
self-hosted: false
release-notes: "{\"en-US\": toJSON(${{ github.event.body }})}" # this should be the content of the release, make sure to include changelog
approval-notes: "Source code is available at https://github.com/kheina-com/Blue-Blocker and the extension can be built and tested locally using `make firefox`"
license: MPL-2.0
jwt-issuer: ${{ secrets.MOZILLA_ADDONS_JWT_ISSUER }}
jwt-secret: ${{ secrets.MOZILLA_ADDONS_JWT_SECRET }}

Release-Chrome:
runs-on: ubuntu-latest
outputs:
filename: ${{ steps.build.outputs.filename }}
steps:
- uses: actions/checkout@v4
- name: build chrome
id: build
run: |
make chrome
echo "filename=blue-blocker-chrome-$(make version).zip" >> "$GITHUB_OUTPUT"
- name: publish chrome
uses: Klemensas/chrome-extension-upload-action@v1
with:
refresh-token: ${{ secrets.CHROME_WEB_STORE_REFRESH_TOKEN }}
client-id: ${{ secrets.CHROME_WEB_STORE_CLIENT_ID }}
client-secret: ${{ secrets.CHROME_WEB_STORE_CLIENT_SECRET }}
file-name: "${{ steps.build.outputs.filename }}"
app-id: 'jgpjphkbfjhlbajmmcoknjjppoamhpmm'
publish: true
4 changes: 4 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ ifneq ($(VERSION), $(PKG_VERSION))
$(error Extension version mismatch. manifest: $(VERSION), package.json: $(PKG_VERSION))
endif

.PHONY: version
version:
@echo ${VERSION}

.PHONY: firefox
firefox:
# ifneq (,$(wildcard blue-blocker-firefox-$(VERSION).zip))
Expand Down

0 comments on commit d6d2a62

Please sign in to comment.