v1.3.1 changelog fix #18
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: "Main" | |
on: | |
push: | |
branches: [main] | |
env: | |
NODE_VERSION: 16 | |
jobs: | |
tests: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [macos-latest, windows-latest, ubuntu-latest] | |
name: Test on ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- run: npm install | |
- run: xvfb-run -a npm run test | |
if: runner.os == 'Linux' | |
- run: npm run test | |
if: runner.os != 'Linux' | |
package-release-publish: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
environment: publishing | |
needs: tests | |
name: Package-Release-Publish | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: setup node.js ${{ env.NODE_VERSION }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: install node deps | |
run: npm ci | |
- name: install vscode marketplace cli (vsce) | |
run: npm install -g vsce | |
- name: install open-vsix marketplace cli (ovsx) | |
run: npm install -g ovsx | |
# - name: install teem keys | |
# run: echo "${{ secrets.TEEM_KEY }}" >> TEEM_KEY | |
- name: package extension | |
id: vsce | |
run: vsce package | |
- name: get extension path | |
run: echo "VSIX_PATH=$(find . -maxdepth 1 -type f -iname "*.vsix" | head -1)" >> $GITHUB_ENV | |
- name: get extension name | |
run: echo "VSIX_NAME=$(basename $(find . -maxdepth 1 -type f -iname "*.vsix" | head -1))" >> $GITHUB_ENV | |
- name: get extension version | |
run: echo "PACKAGE_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV | |
# https://github.com/marketplace/actions/changelog-reader | |
- name: Get Changelog Entry | |
id: changelog_reader | |
uses: mindsers/changelog-reader-action@v2 | |
with: | |
validation_level: warn | |
version: ${{ env.PACKAGE_VERSION }} | |
path: ./CHANGELOG.md | |
- name: create upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
path: ${{ env.VSIX_PATH }} | |
name: ${{ env.VSIX_NAME }} | |
- name: create github release | |
uses: ncipollo/release-action@v1 | |
id: create_release | |
with: | |
tag: v${{ env.PACKAGE_VERSION }} | |
name: ${{ env.VSIX_NAME }} | |
body: "${{ steps.changelog_reader.outputs.changes }}" | |
artifacts: ${{ env.VSIX_NAME }} | |
draft: false | |
prerelease: false | |
- name: publish to marketplace | |
run: vsce publish -i ${{ env.VSIX_PATH }} -p ${{ secrets.MARKETPLACE_PUBLISH_KEY }} | |
- name: publish to open-vsix | |
run: ovsx publish ${{ env.VSIX_PATH }} -p ${{ secrets.OPEN_VSX_TOKEN }} | |
# good example of action workflow for publishing an extension | |
# https://github.com/politie/omt-odt-language/pull/30/files#diff-87db21a973eed4fef5f32b267aa60fcee5cbdf03c67fafdc2a9b553bb0b15f34 | |
# vsce source for understanding switches | |
# https://github.com/microsoft/vscode-vsce/tree/main/src | |
# ovsx source | |
# https://github.com/eclipse/openvsx | |
# another ci/cd example | |
# https://dev.to/shaimendel/vs-code-extension-building-auto-ci-cd-with-github-actions-2dmf | |
# https://github.com/shaimendel/vscode-plugin-cicd-github-actions/blob/master/.github/workflows/ci.yaml |