|
1 | 1 | name: Plugin Updater |
2 | 2 |
|
3 | 3 | on: |
4 | | - schedule: |
5 | | - - cron: "0 0 * * *" |
6 | 4 | workflow_dispatch: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - main |
| 8 | + paths: |
| 9 | + - webcomponents/**.js |
| 10 | + - webcomponents/**.ts |
| 11 | + - webcomponents/**.json |
| 12 | + - webcomponents/**.svelte |
7 | 13 |
|
8 | 14 | jobs: |
9 | | - Update: |
| 15 | + build-webcomponents: |
| 16 | + name: Build web components |
10 | 17 | runs-on: ubuntu-latest |
11 | 18 | steps: |
12 | | - - uses: actions/checkout@v2 |
| 19 | + - uses: actions/checkout@v4 |
13 | 20 | with: |
14 | 21 | token: ${{ secrets.UPDATER }} |
15 | | - |
16 | | - - uses: actions/setup-python@v2 |
| 22 | + - name: Setup Node |
| 23 | + uses: actions/setup-node@v4 |
17 | 24 | with: |
18 | | - python-version: "3.x" |
19 | | - |
20 | | - - name: Install Dependencies |
21 | | - run: pip install -r ./ci/envs/requirements-plugin.txt |
22 | | - |
23 | | - - name: Update Plugin Informations |
24 | | - run: python ./ci/src/plugin_updater.py |
25 | | - env: |
26 | | - GH_TOKEN: ${{ github.token }} |
27 | | - REPOSITORY: "Flow-Launcher/Flow.Launcher.PluginsManifest" |
28 | | - PLUGIN_JSON: "plugins.json" |
29 | | - PLUGIN_MARKDOWN: "plugins.md" |
30 | | - PLUGIN_NAME: "Name" |
31 | | - PLUGIN_AUTHOR: "Author" |
32 | | - PLUGIN_DESCRIPTION: "Description" |
33 | | - PLUGIN_VERSION: "Version" |
34 | | - PLUGIN_WEBSITE: "Website" |
35 | | - |
36 | | - - name: Commit & Push changes |
37 | | - uses: stefanzweifel/git-auto-commit-action@v4 |
| 25 | + node-version: 20 |
| 26 | + - name: Get version |
| 27 | + id: version |
| 28 | + run: | |
| 29 | + version=$(jq -r .version webcomponents/package.json) |
| 30 | + echo "version=$version" >> $GITHUB_OUTPUT |
| 31 | + - name: Build |
| 32 | + run: | |
| 33 | + cd webcomponents |
| 34 | + npm install |
| 35 | + npm run build |
| 36 | + git config --local user.name "github-actions[bot]" |
| 37 | + git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" |
| 38 | + git add dist |
| 39 | + git commit -m "Update web components build artifact" |
| 40 | + - name: Put new build into the repo |
| 41 | + uses: ad-m/github-push-action@master |
38 | 42 | with: |
39 | | - commit_message: "DOC: update plugin list" |
40 | | - push_options: --force |
41 | | - branch: main |
| 43 | + github_token: ${{ secrets.UPDATER }} |
| 44 | + branch: ${{ github.ref }} |
0 commit comments