Skip to content

Commit

Permalink
ci: create two jobs, one which builds the extension, the other releas…
Browse files Browse the repository at this point in the history
…es the extension
  • Loading branch information
delafthi committed Feb 22, 2023
1 parent 3433c16 commit b57830a
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,25 @@ on:
types: [created]

jobs:
build:
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
name: Build
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.x
cache: "yarn"
- name: Package
run: yarn install
release:
runs-on: ubuntu-latest
needs: build
if: startsWith(github.ref, 'refs/tags/v')
name: Release
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand All @@ -17,14 +34,12 @@ jobs:
- name: Package
run: yarn install
- name: Get Package Assets
if: success() && startsWith(github.ref, 'refs/tags/v')
run: |
echo "VSIX_PATH=$(find . -maxdepth 1 -type f -iname "*.vsix" | head -1)" >> $GITHUB_ENV
echo "VSIX_NAME=$(basename $(find . -maxdepth 1 -type f -iname "*.vsix" | head -1))" >> $GITHUB_ENV
- name: Release
id: create_release
uses: actions/create-release@v1
if: success() && startsWith(github.ref, 'refs/tags/v')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand All @@ -35,7 +50,6 @@ jobs:
prerelease: false
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
if: success() && startsWith(github.ref, 'refs/tags/v')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand All @@ -44,7 +58,6 @@ jobs:
asset_name: ${{ env.VSIX_NAME }}
asset_content_type: application/zip
- name: Publish
if: success() && startsWith(github.ref, 'refs/tags/v')
run: yarn deploy
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}

0 comments on commit b57830a

Please sign in to comment.