Skip to content

Commit

Permalink
fix(workflows): changelog generation in release process (#2704)
Browse files Browse the repository at this point in the history
  • Loading branch information
PKief committed Nov 13, 2024
1 parent 246ce37 commit 7cb05b2
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 202 deletions.
52 changes: 17 additions & 35 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,6 @@ name: 🚀 Release + Publish

on:
workflow_dispatch:
inputs:
versionChange:
type: choice
description: Select the version change
required: true
default: "minor"
options:
- major
- minor
- patch

permissions:
id-token: write
Expand All @@ -20,16 +10,15 @@ permissions:
jobs:
release:
runs-on: ubuntu-latest
env:
VERSION_CHANGE: ${{ github.event.inputs.versionChange }}

permissions:
contents: write
id-token: write
attestations: write

steps:
- uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0
- name: ✅ Use App Token for the Bot which is allowed to create releases
uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0
id: app-token
with:
app-id: ${{ vars.BOT_APP_ID }}
Expand All @@ -52,13 +41,19 @@ jobs:
bun install --frozen-lockfile
bun add -g npm
- name: 🔄 Update version
- name: 🔧 Configure Git
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git config --global push.followTags true
npm version ${{ env.VERSION_CHANGE }} -m "Release %s"
- name: 🚀 Prepare release
run: bun run preversion

- name: 📜 Generate changelog and release notes
run: |
bunx changelogen --release --push
bunx changelogen github release --token ${{ secrets.GITHUB_TOKEN }}
- name: 📝 Get metadata
run: |
Expand All @@ -70,13 +65,6 @@ jobs:
echo "NAME=$NAME" >> $GITHUB_ENV
echo "DISPLAY_NAME=$DISPLAY_NAME" >> $GITHUB_ENV
- name: 📜 Generate changelog and release notes
run: |
release_notes="$(bun run changelog --version ${{ env.VERSION }})"
echo "RELEASE_NOTES=$release_notes" >> $GITHUB_ENV
git add CHANGELOG.md
- name: 🛠️ Build extension
run: bunx @vscode/vsce package

Expand All @@ -86,18 +74,6 @@ jobs:
with:
subject-path: "${{ env.NAME }}-${{ env.VERSION }}.vsix"

- name: 📌 Push tags
run: git push

- name: 🚀 Release ${{ env.VERSION }}
uses: softprops/action-gh-release@01570a1f39cb168c169c802c3bceb9e93fb10974 # v2.1.0
with:
files: ${{ env.NAME }}-${{ env.VERSION }}.vsix
tag_name: v${{ env.VERSION }}
body: ${{ env.RELEASE_NOTES }}
name: ${{ env.DISPLAY_NAME }} v${{ env.VERSION }}
generate_release_notes: false

- name: 🌐 Publish to Open VSX Registry
uses: HaaLeo/publish-vscode-extension@28e2d3f5817fccf23c1f219eb0cecc903132d1a2 # v1.6.2
with:
Expand All @@ -115,3 +91,9 @@ jobs:
run: |
npm set "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}"
npm publish --provenance --access public
- name: ⬆️ Upload VSIX to GitHub release
run: |
gh release upload v${{ env.VERSION }} ${{ env.NAME }}-${{ env.VERSION }}.vsix
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18 changes: 0 additions & 18 deletions changelog.config.ts

This file was deleted.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"postcompile": "bun run compile:declarations && bun run generateJson && bun run generateClones && bun run check",
"build": "bun run compile && bun ./build/build-with-esbuild.ts",
"watch": "bun ./build/watch-with-esbuild.ts",
"changelog": "bun --bun ./src/scripts/generateChangelog.ts",
"check-colors": "bun ./src/scripts/svg/checkSvgColors.ts",
"check": "bun ./src/scripts/icons/checks/run.ts",
"contributors": "bun ./src/scripts/contributors/contributors.ts",
Expand Down
148 changes: 0 additions & 148 deletions src/scripts/generateChangelog.ts

This file was deleted.

0 comments on commit 7cb05b2

Please sign in to comment.