-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor the ci to make it easier to publish versions
- Loading branch information
1 parent
97ad1e8
commit 547d858
Showing
3 changed files
with
78 additions
and
132 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
name: 'Build' | ||
|
||
env: | ||
NODE_VERSION: '16' # Shipped with VS Code. | ||
ARTIFACT_NAME_VSIX: vsix | ||
VSIX_NAME: vscode-pyright.vsix | ||
VSIX_PATH: packages/vscode-pyright/${{ env.VSIX_NAME }} | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build-and-release: | ||
runs-on: ubuntu-latest | ||
name: Build | ||
permissions: | ||
id-token: write | ||
contents: write | ||
packages: write | ||
pull-requests: read | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
|
||
- name: Get npm cache directory | ||
id: npm-cache | ||
run: | | ||
echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT | ||
- uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.npm-cache.outputs.dir }} | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- id: current-version | ||
run: echo ::set-output name=CURRENT_VERSION::$(./pw pdm show --version) | ||
|
||
# https://github.com/pdm-project/pdm/issues/2561 | ||
- run: lerna version ${{ steps.current-version.outputs.CURRENT_VERSION }} --force-publish --no-git-tag-version | ||
|
||
- run: npm run install:all | ||
|
||
- name: Build VSIX | ||
working-directory: packages/vscode-pyright | ||
run: | | ||
npm run package | ||
mv basedpyright-*.vsix ${{ env.VSIX_NAME }} | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ env.ARTIFACT_NAME_VSIX }} | ||
path: ${{ env.VSIX_PATH }} | ||
|
||
- name: publish pypi package | ||
run: ./pw pdm publish | ||
|
||
# https://code.visualstudio.com/api/working-with-extensions/publishing-extension#get-a-personal-access-token | ||
- name: Publish VSIX | ||
run: vsce publish --packagePath ${{ env.VSIX_PATH }} --pat ${{ secrets.VSCE_TOKEN }} --noVerify | ||
|
||
- uses: marvinpinto/[email protected] | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
prerelease: false | ||
files: | | ||
dist/* | ||
${{ env.VSIX_PATH }} | ||
automatic_release_tag: v${{ steps.current-version.outputs.CURRENT_VERSION }} |
This file was deleted.
Oops, something went wrong.