Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 23 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,23 @@ on:
workflow_dispatch:
inputs:
releaseType:
description: 'Release Type'
description: "Release Type"
required: true
type: choice
default: 'patch'
default: "patch"
options:
- patch
- minor
- major
releaseChannel:
description: 'Release Channel'
description: "Release Channel"
required: true
type: choice
default: pre
default: next
options:
- stable
- pre
- next
- nextmajor

jobs:
release:
Expand Down Expand Up @@ -47,22 +48,22 @@ jobs:
- name: Setup Node version
uses: actions/setup-node@v4
with:
scope: '@vscode-elements'
scope: "@vscode-elements"
node-version: 22
registry-url: 'https://registry.npmjs.org'
cache: 'npm'
registry-url: "https://registry.npmjs.org"
cache: "npm"
cache-dependency-path: |
package-lock.json

- name: Install dependencies
run: npm ci

- name: Bump version (Pre)
- name: Bump version (Next)
run: |
RELEASE_VERSION=$(npx semver -i prerelease --preid=pre $CURRENT_VERSION)
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV
npm version $RELEASE_VERSION --git-tag-version=false
if: ${{ github.event.inputs.releaseChannel == 'pre' }}
if: ${{ github.event.inputs.releaseChannel == 'next' || github.event.inputs.releaseChannel == 'nextmajor' }}

- name: Bump version (Stable)
run: |
Expand Down Expand Up @@ -100,23 +101,29 @@ jobs:
export GIT_TAG=$(git describe --tags --abbrev=0)
echo "GIT_TAG=$GIT_TAG" >> $GITHUB_ENV

- name: Publish to Npmjs.com (Pre)
- name: Publish to Npmjs.com (Next)
run: npm publish --access=public --tag=next vscode-elements-elements-${{ env.RELEASE_VERSION }}.tgz
env:
NODE_AUTH_TOKEN: ${{ secrets.ORG_NPM_TOKEN }}
if: ${{ github.event.inputs.releaseChannel == 'pre' }}
if: ${{ github.event.inputs.releaseChannel == 'next' }}

- name: Publish to Npmjs.com (Next Major)
run: npm publish --access=public --tag=nextmajor vscode-elements-elements-${{ env.RELEASE_VERSION }}.tgz
env:
NODE_AUTH_TOKEN: ${{ secrets.ORG_NPM_TOKEN }}
if: ${{ github.event.inputs.releaseChannel == 'nextmajor' }}

- name: Publish to Npmjs.com (Stable)
run: npm publish --access=public vscode-elements-elements-${{ env.RELEASE_VERSION }}.tgz
env:
NODE_AUTH_TOKEN: ${{ secrets.ORG_NPM_TOKEN }}
if: ${{ github.event.inputs.releaseChannel == 'stable' }}

- name: Github Release (Pre)
- name: Github Release (Next)
uses: ncipollo/release-action@v1
if: ${{ github.event.inputs.releaseChannel == 'pre' }}
if: ${{ github.event.inputs.releaseChannel == 'next' || github.event.inputs.releaseChannel == 'nextmajor' }}
with:
artifacts: './vscode-elements-elements-*'
artifacts: "./vscode-elements-elements-*"
prerelease: true
draft: true
tag: ${{ env.GIT_TAG }}
Expand All @@ -126,7 +133,7 @@ jobs:
uses: ncipollo/release-action@v1
if: ${{ github.event.inputs.releaseChannel == 'stable' }}
with:
artifacts: './vscode-elements-elements-*'
artifacts: "./vscode-elements-elements-*"
prerelease: false
draft: true
tag: ${{ env.GIT_TAG }}
Expand Down
Loading