Merge branch 'khbsd_dev' of https://github.com/ghostboats/bg3_mod_hel… #296
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 Workflow | |
on: | |
push: | |
branches: | |
#- prod | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
outputs: | |
vsix_filename: ${{ steps.set_vsix_name.outputs.vsix_filename }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '20.11.1' | |
- name: Install dependencies | |
run: npm install | |
- name: Install VSCE and OVSX | |
run: | | |
npm install -g vsce | |
npm install -g ovsx | |
- name: Build and package VS Code extension | |
run: vsce package | |
id: package_extension | |
- name: List contents of the VSIX package | |
run: vsce ls | |
- name: Get version from package.json | |
id: get_version | |
run: echo "::set-output name=version::$(jq -r .version package.json)" | |
shell: bash | |
- name: Set VSIX filename | |
id: set_vsix_name | |
run: echo "::set-output name=vsix_filename::bg3-mod-helper-${{ steps.get_version.outputs.version }}.vsix" | |
shell: bash | |
- name: Log file size | |
run: ls -lh "${{ steps.set_vsix_name.outputs.vsix_filename }}" | |
- name: Upload VSIX as artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: vsix-file | |
path: ${{ steps.set_vsix_name.outputs.vsix_filename }} | |
- name: Log VSCE version | |
run: vsce --version | |
- name: Log OVSX version | |
run: ovsx --version | |
- name: Log .vscodeignore contents | |
run: cat .vscodeignore | |
- name: Log npm dependencies | |
run: npm list | |
publish: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download VSIX artifact | |
uses: actions/download-artifact@v2 | |
with: | |
name: vsix-file | |
path: ./ | |
- name: Publish to Visual Studio Code Marketplace | |
env: | |
VSCODE_MARKETPLACE_TOKEN: ${{ secrets.VSCODE_MARKETPLACE_TOKEN }} | |
run: vsce publish --pat $VSCODE_MARKETPLACE_TOKEN --packagePath ${{ needs.build.outputs.vsix_filename }} | |
- name: Publish to VSCodium (Open VSX Registry) | |
env: | |
OPEN_VSX_TOKEN: ${{ secrets.OPEN_VSX_TOKEN }} | |
run: ovsx publish -p $OPEN_VSX_TOKEN --packagePath ${{ needs.build.outputs.vsix_filename }} | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: v${{ steps.get_version.outputs.version }} | |
release_name: Release v${{ steps.get_version.outputs.version }} | |
draft: false | |
prerelease: false | |
- name: Upload Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ${{ needs.build.outputs.vsix_filename }} | |
asset_name: ${{ needs.build.outputs.vsix_filename }} | |
asset_content_type: application/octet-stream |