Skip to content

Commit

Permalink
chore: auto generate extension lists
Browse files Browse the repository at this point in the history
Note: Updating the manual-publish.yml is a manual process.
  • Loading branch information
Jason3S committed Jan 8, 2023
1 parent a0f7715 commit a4418ee
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 44 deletions.
73 changes: 37 additions & 36 deletions .github/workflows/manual-publish.yml
Expand Up @@ -9,48 +9,49 @@ on:
inputs:
ref:
description: >-
The branch, tag or SHA to checkout. When checking out the repository that
triggered a workflow, this defaults to the reference or SHA for that event.
Otherwise, uses the default branch.
The branch, tag or SHA to checkout. When checking out the
repository that triggered a workflow, this defaults to the reference
or SHA for that event. Otherwise, uses the default branch.
required: true
default: main
extension:
description: The Extension to publish
type: choice
# Options are can be generated from `./scripts/extensions.sh`
# Options are generated from `npm run gen:workflow`
options:
[
".",
"extensions/arabic",
"extensions/bulgarian",
"extensions/catalan",
"extensions/croatian",
"extensions/czech",
"extensions/danish",
"extensions/dutch",
"extensions/esperanto",
"extensions/estonian",
"extensions/french-reforme",
"extensions/french",
"extensions/german",
"extensions/greek",
"extensions/hebrew",
"extensions/italian",
"extensions/medical-terms",
"extensions/norwegian-bokmal",
"extensions/persian",
"extensions/polish",
"extensions/portuguese-brazilian",
"extensions/portuguese",
"extensions/russian",
"extensions/scientific-terms",
"extensions/slovenian",
"extensions/spanish",
"extensions/swedish",
"extensions/turkish",
"extensions/ukrainian",
"extensions/vietnamese",
]
- "."
- extensions/arabic
- extensions/basque
- extensions/bulgarian
- extensions/catalan
- extensions/croatian
- extensions/czech
- extensions/danish
- extensions/dutch
- extensions/esperanto
- extensions/estonian
- extensions/french
- extensions/french-reforme
- extensions/german
- extensions/greek
- extensions/hebrew
- extensions/hunspell-syntax
- extensions/italian
- extensions/medical-terms
- extensions/norwegian-bokmal
- extensions/persian
- extensions/polish
- extensions/portuguese
- extensions/portuguese-brazilian
- extensions/russian
- extensions/scientific-terms
- extensions/serbian
- extensions/slovenian
- extensions/spanish
- extensions/swedish
- extensions/turkish
- extensions/ukrainian
- extensions/vietnamese
required: false

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update-extension-list.yml
Expand Up @@ -31,11 +31,11 @@ jobs:

- name: Update Workspace
run: |
./scripts/update-code-workspace.sh
npm run gen:readme
- name: Update Release Please Packages
run: |
./scripts/gen-release-please-config.sh
npm run gen:release-please
- name: PR
uses: ./.github/actions/pr
Expand Down
3 changes: 3 additions & 0 deletions package.json
Expand Up @@ -8,6 +8,9 @@
"pub-version": "lerna version --conventional-commits",
"publish-all": "lerna exec --no-bail \"vsce publish\"",
"publish-all-ovsx": "lerna exec --no-bail \"ovsx publish --pat \\$OVSX_TOKEN\"",
"gen:readme": "./scripts/update-code-workspace.sh",
"gen:release-please": "./scripts/gen-release-please-config.sh",
"gen:workflow": "./scripts/update-workflows.sh",
"echo": "echo $OVSX_TOKEN",
"build": "lerna run build",
"test-pack": "lerna run pack-extension",
Expand Down
12 changes: 6 additions & 6 deletions scripts/update-code-workspace.sh
@@ -1,6 +1,10 @@
#!/bin/bash

SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
ROOT=$(dirname "$SCRIPT_DIR")

cd $ROOT

JQ_FILTER_PACKAGES="$SCRIPT_DIR/code-workspace-packages.jq"
JQ_FILTER_CONFIG="$SCRIPT_DIR/gen-release-please-config.jq"

Expand All @@ -15,12 +19,8 @@ echo "$RESULT" > ./dict-extensions.code-workspace

# Update README.md

./scripts/gen-extension-list.mjs
$SCRIPT_DIR/gen-extension-list.mjs

npx prettier -w static/generated/*.md
npx inject-markdown README.md
npx prettier -w README.md

# Update .github/workflows/manual-publish.yml

./scripts/update-manual-pub-list.mjs
npx prettier -w .github/workflows/*
11 changes: 11 additions & 0 deletions scripts/update-workflows.sh
@@ -0,0 +1,11 @@
#!/bin/bash

SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
ROOT=$(dirname $SCRIPT_DIR)

cd $ROOT

# Update .github/workflows/manual-publish.yml

$SCRIPT_DIR/update-manual-pub-list.mjs
npx prettier -w .github/workflows/manual-publish.yml

0 comments on commit a4418ee

Please sign in to comment.