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.

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 15, 2021
1 parent 4e9e99d commit 13cd117
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 48 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
51 changes: 42 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,56 @@
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
name: Publish to VS Code Marketplace
runs-on: windows-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 = Get-Content .\.nvmrc -Raw
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: 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 13cd117

Please sign in to comment.