Bump version #15
Workflow file for this run
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: Create Release | |
on: | |
push: | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Create Build | |
runs-on: ubuntu-latest | |
env: | |
PUSH_PACKAGES: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18.x | |
- name: npm ci | |
run: | | |
npm ci | |
- name: npm test [Linux] | |
run: | | |
xvfb-run -a npm test | |
if: runner.os == 'Linux' | |
- name: npm test [!Linux] | |
run: | | |
npm test | |
if: runner.os != 'Linux' | |
- name: Package vsix | |
run: | | |
npm run craft | |
# Release | |
- name: Get version from package.json and set in Env | |
if: ${{ env.PUSH_PACKAGES == 'true' }} | |
run: | | |
sudo apt install jq | |
echo "CORNIFER_VERSION=$(cat package.json | jq -r '.version')" >> $GITHUB_ENV | |
- name: Create Release | |
if: ${{ env.PUSH_PACKAGES == 'true' }} | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: v${{ env.CORNIFER_VERSION }} | |
release_name: ${{ env.CORNIFER_VERSION }} | |
body: | | |
Please check `CHANGELOG.md` for latest fixes and updates. | |
draft: false | |
prerelease: false | |
- name: Upload Cornifer Artifact | |
if: ${{ env.PUSH_PACKAGES == 'true' }} | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: cornifer-${{ env.CORNIFER_VERSION }}.vsix | |
asset_name: cornifer-${{ env.CORNIFER_VERSION }}.vsix | |
asset_content_type: application |