Publish VSIX #69
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish VSIX | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Version to release' | |
required: true | |
jobs: | |
publish-vsix: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.SOURCERY_RELEASE_TOKEN }} | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: latest | |
- run: yarn install --frozen-lockfile | |
- name: Update binaries | |
run: | | |
./download-binaries.sh ${{ github.event.inputs.version }} | |
- name: Update version number | |
run: yarn run bump ${{ github.event.inputs.version }} | |
- name: Commit to main, create tag, and push | |
run: | | |
git add . | |
git config --global user.name ${{ github.actor }} | |
git config --global user.email ${{ github.actor }}@users.noreply.github.com | |
git commit -m 'Update version number to v${{ github.event.inputs.version }}' | |
git tag v${{ github.event.inputs.version }} | |
git push origin main v${{ github.event.inputs.version }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.SOURCERY_RELEASE_TOKEN }} | |
- name: Package and publish VSCode extension | |
run: | | |
yarn run vsce package | |
yarn run vsce publish -p ${{ secrets.VSCE_TOKEN }} | |
- name: Upload archive | |
uses: actions/upload-artifact@v3 | |
with: | |
path: sourcery-${{ github.event.inputs.version }}.vsix | |
- name: Create release | |
uses: ncipollo/release-action@v1 | |
with: | |
tag: v${{ github.event.inputs.version }} | |
name: Sourcery ${{ github.event.inputs.version }} | |
body: v${{ github.event.inputs.version }} | |
prerelease: false | |
artifacts: sourcery-${{ github.event.inputs.version }}.vsix | |
artifactContentType: raw | |
artifactErrorsFailBuild: true | |
token: ${{ secrets.SOURCERY_RELEASE_TOKEN }} | |
- name: Update version number to dev | |
run: | | |
yarn run bump prepatch --preid dev | |
git commit -am 'Bump version to dev' | |
git push origin main | |
env: | |
GITHUB_TOKEN: ${{ secrets.SOURCERY_RELEASE_TOKEN }} | |
- name: Notify Slack | |
uses: 8398a7/action-slack@v3 | |
with: | |
status: ${{ job.status }} | |
text: Publish VS Code extension v${{ github.event.inputs.version }} - ${{ job.status }} | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_RELEASES_WEBHOOK_URL }} | |
if: always() |