.github/workflows: Convert python to npm semver style.

This commit is contained in:
Laurens Valk
2026-05-29 21:06:31 +02:00
parent 4e78de9d2a
commit f12a6a26ac
4 changed files with 17 additions and 7 deletions
+6 -2
View File
@@ -10,7 +10,11 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Get version from tag
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
run: |
VERSION="${GITHUB_REF_NAME#v}"
NPM_VERSION=$(echo "$VERSION" | sed 's/\([0-9]\)a\([0-9]\)/\1-alpha.\2/;s/\([0-9]\)b\([0-9]\)/\1-beta.\2/;s/\([0-9]\)rc\([0-9]\)/\1-rc.\2/')
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "NPM_VERSION=$NPM_VERSION" >> $GITHUB_ENV
- name: Ubuntu packages
run: |
sudo apt-get update
@@ -32,7 +36,7 @@ jobs:
with:
node-version: '22.x'
registry-url: 'https://registry.npmjs.org'
- run: npm version --no-git-tag-version "$VERSION"
- run: npm version --no-git-tag-version "$NPM_VERSION"
working-directory: npm/ide-docs
- run: yarn build
working-directory: npm/ide-docs
+6 -2
View File
@@ -11,7 +11,11 @@ jobs:
steps:
- uses: actions/checkout@v6
- name: Get version from tag
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
run: |
VERSION="${GITHUB_REF_NAME#v}"
NPM_VERSION=$(echo "$VERSION" | sed 's/\([0-9]\)a\([0-9]\)/\1-alpha.\2/;s/\([0-9]\)b\([0-9]\)/\1-beta.\2/;s/\([0-9]\)rc\([0-9]\)/\1-rc.\2/')
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "NPM_VERSION=$NPM_VERSION" >> $GITHUB_ENV
- name: Set up Python
uses: actions/setup-python@v5
with:
@@ -25,7 +29,7 @@ jobs:
with:
node-version: '22.x'
registry-url: 'https://registry.npmjs.org'
- run: ./build.py "$VERSION"
- run: ./build.py "$NPM_VERSION"
working-directory: npm/jedi
- run: yarn publish
working-directory: npm/jedi/build