Skip to content
This repository has been archived by the owner on May 30, 2024. It is now read-only.

Meta: Use GitHub Actions for automatic deployment #100

Merged
merged 7 commits into from
Oct 25, 2020
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
55 changes: 55 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Copied from https://github.com/notlmn/browser-extension-template/blob/master/.github/workflows/release.yml
name: Release

on:
workflow_dispatch:
# You can manually trigger a deployment on GitHub.com
# https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/
schedule:
- cron: '42 4 * * 4' # At 04:42 every Thursday

jobs:
Version:
outputs:
created: ${{ steps.daily-version.outputs.created }}
version: ${{ steps.daily-version.outputs.version }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 20
- run: npm install
- run: npm test
- uses: fregante/daily-version-action@v1
name: Create tag if necessary
id: daily-version
- uses: notlmn/release-with-changelog@v3
if: steps.daily-version.outputs.created
with:
token: ${{ secrets.GITHUB_TOKEN }}
exclude: '^Meta|^Document|^Readme|^Lint'

Submit:
needs: Version
if: github.event_name == 'workflow_dispatch' || needs.Version.outputs.created
strategy:
fail-fast: false
matrix:
command:
- firefox
- chrome
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm install
- run: npm run build
- name: Update extension’s meta
run: npx dot-json distribution/manifest.json version ${{ needs.Version.outputs.version }}
- run: npm run release:${{ matrix.command }}
env:
EXTENSION_ID: ${{ secrets.EXTENSION_ID }}
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }}
WEB_EXT_API_KEY: ${{ secrets.WEB_EXT_API_KEY }}
WEB_EXT_API_SECRET: ${{ secrets.WEB_EXT_API_SECRET }}
11 changes: 11 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Test

on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm install
- run: npm test
fregante marked this conversation as resolved.
Show resolved Hide resolved
12 changes: 0 additions & 12 deletions .travis.yml

This file was deleted.

15 changes: 15 additions & 0 deletions package-lock.json

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

7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
"test": "npm run build && xo",
"build": "webpack --mode=production",
"watch": "webpack --mode=development --watch",
"release:amo": "cd distribution && web-ext-submit",
"release:cws": "cd distribution && webstore upload --auto-publish",
"release": "run-s build update-version release:*",
"update-version": "dot-json distribution/manifest.json version $TRAVIS_TAG"
"release:chrome": "cd distribution && webstore upload --auto-publish",
"release:firefox": "cd distribution && web-ext-submit"
},
"dependencies": {
"dom-chef": "^4.1.0",
Expand All @@ -26,6 +24,7 @@
"@types/terser-webpack-plugin": "^4.0.0",
"chrome-webstore-upload-cli": "^1.2.0",
"copy-webpack-plugin": "^6.0.3",
"daily-version": "^2.0.0",
"dot-json": "^1.2.0",
"eslint-config-xo-react": "^0.23.0",
"eslint-plugin-react": "^7.20.5",
Expand Down