From 673f5d3413e852128feaebafb01a8d8259a4a770 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Pupier?= Date: Fri, 22 Jul 2022 15:49:21 +0200 Subject: [PATCH 1/2] Provide GitHub Action to build extension on master branch update and Pull requests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fixes #80 Signed-off-by: Aurélien Pupier --- .github/workflows/build.yaml | 26 +++++++++++++++++++ .../workflows/{build.yml => publishTags.yml} | 0 2 files changed, 26 insertions(+) create mode 100644 .github/workflows/build.yaml rename .github/workflows/{build.yml => publishTags.yml} (100%) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..bf6c025 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,26 @@ +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + workflow_dispatch: + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: '16' + cache: 'npm' + - name: Install global dependencies + run: npm install -g typescript vsce + - name: npm-ci + run: npm ci + - name: npm-compile + run: npm run compile + - name: vsce package + run: vsce package diff --git a/.github/workflows/build.yml b/.github/workflows/publishTags.yml similarity index 100% rename from .github/workflows/build.yml rename to .github/workflows/publishTags.yml From 548338e10853fa969390b28a9928e35d41c04927 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Pupier?= Date: Fri, 22 Jul 2022 16:13:35 +0200 Subject: [PATCH 2/2] Update GitHub Action to publish extension on tag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fixes #86 Signed-off-by: Aurélien Pupier --- .github/CONTRIBUTING.md | 13 ++++--------- .github/workflows/publishTags.yml | 11 ++++++----- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 91abe1d..86482b3 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,11 +1,6 @@ # Publishing a release -See [Publishing Extensions](https://code.visualstudio.com/api/working-with-extensions/publishing-extension). - -```console -# Change version in package.json first! -$ vsce package -$ vsce publish -``` - -Then cut a new GitHub release. +* Ensure version in package.json has not been published yet. If already published, increase it (do nto forget package-lock.json). This kind of command be used: `npm version --no-git-tag-version patch` +* Create a tag and potentially a GitHub release +* Check GitHub Action `Publish Extension on tag` workflow has been triggered and is successful +* It is a good habit to upgrade the version after a successful publish, for instance with this kind of command: `npm version --no-git-tag-version patch` diff --git a/.github/workflows/publishTags.yml b/.github/workflows/publishTags.yml index 9e16eab..61a3053 100644 --- a/.github/workflows/publishTags.yml +++ b/.github/workflows/publishTags.yml @@ -3,22 +3,23 @@ on: tags: - "*" -name: Deploy Extension +name: Publish Extension on tag jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 + - uses: actions/setup-node@v2 with: - node-version: 12 + node-version: '16' + cache: 'npm' - run: npm ci - name: Publish to Open VSX Registry - uses: HaaLeo/publish-vscode-extension@v0 + uses: HaaLeo/publish-vscode-extension@v1 with: pat: ${{ secrets.OPEN_VSX_TOKEN }} - name: Publish to Visual Studio Marketplace - uses: HaaLeo/publish-vscode-extension@v0 + uses: HaaLeo/publish-vscode-extension@v1 with: pat: ${{ secrets.VS_MARKETPLACE_TOKEN }} registryUrl: https://marketplace.visualstudio.com