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: Release | |
on: | |
push: | |
tags: | |
- 'v*.*.*' # Triggers the workflow when pushing a tag that matches the pattern, e.g., v1.0.0 | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20' # Or any other Node.js version your project requires | |
- name: Install dependencies | |
run: npm install -g @vscode/vsce && ./refresh_submodules | |
- name: Build VS Code extension package | |
run: npm run package | |
- name: Run some command that requires GitHub token | |
run: | | |
echo "Using GitHub Token: $GITHUB_TOKEN" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create GitHub release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref_name }} | |
release_name: Release ${{ github.ref_name }} | |
draft: false | |
prerelease: false | |
- name: Get version from package.json | |
id: get_version | |
run: echo "VERSION=$(jq -r '.version' package.json)" >> $GITHUB_ENV && echo $GITHUB_ENV | |
- name: Upload VS Code extension package to release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./omnetpp-vscode-${{ env.VERSION }}.vsix | |
asset_name: omnetpp-vscode-${{ env.VERSION }}.vsix | |
asset_content_type: application/vsix |