Skip to content

Commit

Permalink
build(ci): apply cherry-pick from #1825 for cron build
Browse files Browse the repository at this point in the history
  • Loading branch information
Rhilip committed May 5, 2024
1 parent b13a533 commit 25458c9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 29 deletions.
33 changes: 12 additions & 21 deletions .github/workflows/build_action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,33 +31,24 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
fetch-depth: 0

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '16'
node-version: '20'

This comment has been minimized.

Copy link
@trim21

trim21 May 5, 2024

master分支的toolchain还是旧的,没法用node20

cache: yarn

- name: Get yarn cache
id: yarn-cache
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn

- run: yarn build
continue-on-error: true

- name: Upload Built to action
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: build-dist-folder
path: dist
Expand All @@ -69,7 +60,7 @@ jobs:
outputs:
version: ${{ steps.zip.outputs.extensionVersion }}
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: build-dist-folder
path: dist
Expand All @@ -82,7 +73,7 @@ jobs:
zipFilePath: 'artifact/extension.zip'

- name: Upload Built Zip to action
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: dev-build-${{ steps.zip.outputs.extensionVersion }}-zip
path: artifact/*
Expand All @@ -101,7 +92,7 @@ jobs:
USER_INPUT=${{ inputs.auto_update_file }}
echo "value=${USER_INPUT:-"stable.xml"}" >> $GITHUB_OUTPUT
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
env:
CRX_PRIVATE_KEY: ${{ secrets.CRX_PRIVATE_KEY }}
if: ${{ env.CRX_PRIVATE_KEY != '' }}
Expand Down Expand Up @@ -141,7 +132,7 @@ jobs:
env:
CRX_PRIVATE_KEY: ${{ secrets.CRX_PRIVATE_KEY }}
if: ${{ env.CRX_PRIVATE_KEY != '' }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: dev-build-${{ steps.zip.outputs.extensionVersion }}-crx
path: artifact/*
Expand All @@ -154,7 +145,7 @@ jobs:
outputs:
exist_xpi_file: ${{ steps.addonsDeploy.outcome }}
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: dev-build-${{ needs.zip.outputs.version }}-zip

Expand All @@ -173,7 +164,7 @@ jobs:
jwtSecret: ${{ secrets.FF_JWT_SECRET }}

- name: Upload Built Xpi to action
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: ${{ steps.addonsDeploy.outcome == 'success' }}
with:
name: dev-build-${{ needs.zip.outputs.version }}-xpi
Expand Down
14 changes: 6 additions & 8 deletions .github/workflows/build_canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,14 @@ jobs:
run: mkdir build

- name: Get And rename Zip build
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name:
dev-build-${{ needs.action.outputs.version }}-zip
name: dev-build-${{ needs.action.outputs.version }}-zip

- run: mv extension.zip build/PT-Plugin-Plus-${{ needs.action.outputs.version }}.zip

- name: Get And remove Crx Build
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name:
dev-build-${{ needs.action.outputs.version }}-crx
Expand All @@ -53,19 +52,18 @@ jobs:
mv extension.crx build/PT-Plugin-Plus-${{ needs.action.outputs.version }}.crx
- name: Get And move Xpi Build
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
if: ${{ needs.action.outputs.buildXPI == 'success' }}
with:
name:
dev-build-${{ needs.action.outputs.version }}-xpi
name: dev-build-${{ needs.action.outputs.version }}-xpi

- if: ${{ needs.action.outputs.buildXPI == 'success' }}
run: |
mv extension.signed.xpi build/PT-Plugin-Plus-${{ needs.action.outputs.version }}.xpi
echo $(jq '.addons[].updates += [{"version": "${{ needs.action.outputs.version }}", "update_link": "https://github.com/pt-plugins/PT-Plugin-Plus/releases/download/v${{ needs.action.outputs.version }}/PT-Plugin-Plus-${{ needs.action.outputs.version }}.xpi"}]' pages/update/firefox.json) > pages/update/firefox.json
- name: Deploy update xml and json
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./pages
Expand Down

0 comments on commit 25458c9

Please sign in to comment.