Skip to content

Commit

Permalink
github: Update publishing workflow & make it single-step
Browse files Browse the repository at this point in the history
Changelog in Marketplace entry is sourced automatically from Changelog.md
We can continue updating that changelog manually and ensure it's not forgotten
via a custom input where a maintainer has to confirm this.

We can also continue copy-pasting the relevant part of changelog
into GitHub Release notes.

We can use Linux instead of Windows since Windows is not a requirement for vsce.

Lastly we should not need to continue publishing the vsix to GitHub
as this encourages a bad practice of users installing released extension
outside of Marketplace.
  • Loading branch information
radeksimko committed Sep 21, 2021
1 parent 8feec0d commit 15ea39d
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 49 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: setup node
uses: actions/setup-node@v1
with:
node-version: '14.x'
node-version: '12.x'

- name: clean install dependencies
run: npm ci
Expand Down
56 changes: 46 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,59 @@
name: Publish release
on:
release:
types:
- published

on:
workflow_dispatch:
inputs:
version:
description: 'Version to publish & tag & push (without "v" prefix)'
required: true
changelog_updated:
description: 'Did you update the changelog? ("yes")'
required: true

jobs:
publish:
name: Publish to Marketplace
runs-on: windows-latest
name: Publish to VS Code Marketplace
runs-on: ubuntu-latest
steps:
- name: Ensure changelog is updated
if: ${{ github.event.inputs.changelog_updated != 'yes' }}
run: |
echo "Response: ${{ github.event.inputs.changelog_updated }} (expected yes)"
exit 1
- name: Check out repository
uses: actions/checkout@v2
- name: Set up Node
- name: Read Node.js version
id: nodejs-version
run: |
content=`cat ./.nvmrc`
echo "::set-output name=content::$content"
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: '14.x'
- name: Clean install dependencies
# See https://github.com/actions/setup-node/issues/32
node-version: ${{ steps.nodejs-version.outputs.content }}
- name: Install dependencies
run: npm ci
- name: Install Terraform
uses: hashicorp/setup-terraform@v1
with:
terraform_wrapper: false
terraform_version: "~1.0"
- name: Set up Xvfb (Ubuntu)
run: |
/usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
- name: npm test
run: npm test
- name: Configure git author
run: |
git config user.email "hashibot-feedback@hashicorp.com"
git config user.name "HashiBot"
- name: vsce publish
run: vsce publish
run: npx -- vsce publish ${{ github.event.inputs.version }}
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
- name: git push
run: |
$defaultBranch = git branch --show-current
git push origin $defaultBranch
git push origin v${{ github.event.inputs.version }}
38 changes: 0 additions & 38 deletions .github/workflows/release.yml

This file was deleted.

0 comments on commit 15ea39d

Please sign in to comment.