Skip to content

Commit

Permalink
refactor: Update CI workflow and publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
maxisam committed Oct 22, 2024
1 parent 92636d9 commit df9cba7
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: 🏃CI

permissions:
contents: write
Expand All @@ -12,7 +12,10 @@ jobs:
test:
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
os:
- ubuntu-latest
# - macos-latest
# - windows-latest
runs-on: ${{ matrix.os }}
outputs:
GIT_TAG: ${{ steps.set-tag.outputs.GIT_TAG }}
Expand Down
60 changes: 60 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: ♨️ Publish

permissions:
contents: write

on:
# on tag push
push:
tags:
- "v[0-9]+"
- "v[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-*"

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get tag from the event
id: get-tag
run: |
echo "GIT_TAG=${{github.ref_name}}" >> $GITHUB_OUTPUT
echo "::notice title=🏷️ Tag::${{ github.ref_name }} @ ${{ github.sha}}"
- name: Check package.json version is the same as the tag
id: check-version
run: |
if [ "v$(jq -r .version package.json)" != "${{ steps.get-tag.outputs.GIT_TAG }}" ]; then
echo "Version in package.json does not match the tag"
exit 1
fi
- uses: pnpm/action-setup@v4
name: Install pnpm

- name: Install Node.js
uses: actions/setup-node@v4
with:
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

- name: Publish to Visual Studio Marketplace
run: pnpm run publish:vs-marketplace
env:
VSCE_PAT: ${{ secrets.VS_MARKETPLACE_TOKEN }}

# - name: Publish to Open VSX Registry
# run: pnpm run publish:open-vsx -p ${{ secrets.OPEN_VSX_TOKEN }}

- name: Github Release
run: npx changelogithub
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 comments on commit df9cba7

Please sign in to comment.