Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/pre_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Pre-release

on: workflow_dispatch

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.PRE_RELEASE_PAT }}
- name: Increment version
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
npm version patch -m "Pre-release %s"
git push --follow-tags
25 changes: 22 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ jobs:
debug-raspberry-pi-pico-*.vsix
raspberry-pi-pico-*.vsix
ovsx-raspberry-pi-pico-*.vsix

# Test PATs
- name: Test PAT
if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') }}
env:
Expand All @@ -72,21 +74,38 @@ jobs:
if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') }}
run: |
npx ovsx verify-pat -p ${{ secrets.OPEN_VSX_PAT }}

# Pre-release
- name: Add Pre-release Notes
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/') && contains(github.event.head_commit.message, 'Pre-release')
with:
prerelease: true
generate_release_notes: true
body: "> **Note: This is a pre-release, so may not be stable**"
files: |
debug-raspberry-pi-pico-*.vsix
raspberry-pi-pico-*.vsix
ovsx-raspberry-pi-pico-*.vsix

# Release
- name: Add Release Asset
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
if: startsWith(github.ref, 'refs/tags/') && !contains(github.event.head_commit.message, 'Pre-release')
with:
files: |
debug-raspberry-pi-pico-*.vsix
raspberry-pi-pico-*.vsix
ovsx-raspberry-pi-pico-*.vsix

# Publishing
- name: Publish Extension
if: startsWith(github.ref, 'refs/tags/')
env:
VSCE_PAT: ${{ secrets.VSCODE_MARKETPLACE_PAT }}
run: |
vsce publish -i raspberry-pi-pico-*.vsix
vsce publish -i ${{ contains(github.event.head_commit.message, 'Pre-release') && 'debug-raspberry-pi-pico-*.vsix --pre-release' || 'raspberry-pi-pico-*.vsix' }}
- name: Publish Extension to OVSX
if: startsWith(github.ref, 'refs/tags/')
run: |
npx ovsx publish ovsx-raspberry-pi-pico-*.vsix -p ${{ secrets.OPEN_VSX_PAT }}
npx ovsx publish ovsx-raspberry-pi-pico-*.vsix -p ${{ secrets.OPEN_VSX_PAT }} ${{ contains(github.event.head_commit.message, 'Pre-release') && '--pre-release' || '' }}
Loading