|
| 1 | +env: |
| 2 | + DIRECTORY: src |
| 3 | + |
| 4 | +# FILE GENERATED WITH: npx ghat fregante/ghatemplates/webext/release.yml |
| 5 | +# SOURCE: https://github.com/fregante/ghatemplates |
| 6 | + |
| 7 | +name: Release |
| 8 | +on: |
| 9 | + workflow_dispatch: null |
| 10 | + schedule: |
| 11 | + - cron: 30 12 2 * * |
| 12 | +jobs: |
| 13 | + Version: |
| 14 | + outputs: |
| 15 | + created: ${{ steps.daily-version.outputs.created }} |
| 16 | + version: ${{ steps.daily-version.outputs.version }} |
| 17 | + runs-on: ubuntu-latest |
| 18 | + steps: |
| 19 | + - uses: actions/checkout@v2 |
| 20 | + with: |
| 21 | + fetch-depth: 20 |
| 22 | + - name: install |
| 23 | + run: npm ci || npm install |
| 24 | + - run: npm test |
| 25 | + - uses: fregante/daily-version-action@v1 |
| 26 | + name: Create tag if necessary |
| 27 | + id: daily-version |
| 28 | + - uses: notlmn/release-with-changelog@v3 |
| 29 | + if: steps.daily-version.outputs.created |
| 30 | + with: |
| 31 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 32 | + exclude: true |
| 33 | + Submit: |
| 34 | + needs: Version |
| 35 | + if: github.event_name == 'workflow_dispatch' || needs.Version.outputs.created |
| 36 | + strategy: |
| 37 | + fail-fast: false |
| 38 | + matrix: |
| 39 | + command: |
| 40 | + # - firefox |
| 41 | + - chrome |
| 42 | + runs-on: ubuntu-latest |
| 43 | + steps: |
| 44 | + - uses: actions/checkout@v2 |
| 45 | + - name: install |
| 46 | + run: npm ci || npm install |
| 47 | + - run: npm run build --if-present |
| 48 | + - name: Update extension’s meta |
| 49 | + run: >- |
| 50 | + npx dot-json@1 $DIRECTORY/manifest.json version ${{ |
| 51 | + needs.Version.outputs.version }} |
| 52 | + - name: Submit |
| 53 | + run: | |
| 54 | + case ${{ matrix.command }} in |
| 55 | + chrome) |
| 56 | + cd $DIRECTORY && npx chrome-webstore-upload-cli@1 upload --auto-publish |
| 57 | + ;; |
| 58 | + firefox) |
| 59 | + cd $DIRECTORY && npx web-ext-submit@5 |
| 60 | + ;; |
| 61 | + esac |
| 62 | + env: |
| 63 | + EXTENSION_ID: ${{ secrets.EXTENSION_ID }} |
| 64 | + CLIENT_ID: ${{ secrets.CLIENT_ID }} |
| 65 | + CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }} |
| 66 | + REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }} |
| 67 | + WEB_EXT_API_KEY: ${{ secrets.WEB_EXT_API_KEY }} |
| 68 | + WEB_EXT_API_SECRET: ${{ secrets.WEB_EXT_API_SECRET }} |
0 commit comments