Bump ts-loader from 9.6.0 to 9.6.2 (#577) #444
This file contains hidden or 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 and Publish extension | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - package.json | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: "Version to release" | |
| required: true | |
| jobs: | |
| check-version-change: | |
| env: | |
| EXT_VERSION: ${{ github.event.inputs.version }} | |
| outputs: | |
| changed: ${{ steps.check-version.outputs.result }} | |
| version: ${{ env.EXT_VERSION }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: "npm" | |
| registry-url: "https://npm.pkg.github.com" | |
| - name: Check if version has changed | |
| id: check-version | |
| uses: actions/github-script@v6 | |
| with: | |
| script: | | |
| const version = '${{ github.event.inputs.version }}' || require('./package.json').version; | |
| // Find a release for that version | |
| const release = await github.rest.repos.getReleaseByTag({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| tag: `v${version}`, | |
| }).catch(() => null); | |
| // If the release exists, the version has not changed | |
| if (release) { | |
| console.log(`Version ${version} has an existing release`); | |
| console.log(release.data.html_url); | |
| core.summary.addLink(`Release v${version}`, release.data.html_url); | |
| await core.summary.write(); | |
| return "false"; | |
| } | |
| console.log(`Version ${version} does not have a release`); | |
| return true; | |
| - name: Export Version | |
| run: | | |
| echo "EXT_VERSION=$(node -p -e "require('./package.json').version")" >> $GITHUB_ENV | |
| release: | |
| name: Release extension v${{ needs.check-version-change.outputs.version }} for ${{ matrix.vsce_target }} | |
| needs: | |
| - check-version-change | |
| if: ${{ needs.check-version-change.outputs.changed == 'true' }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| packages: read | |
| env: | |
| EXT_VERSION: ${{ needs.check-version-change.outputs.version }} | |
| strategy: | |
| matrix: | |
| include: | |
| - vsce_target: web | |
| ls_target: web_noop | |
| npm_config_arch: x64 | |
| - vsce_target: linux-x64 | |
| ls_target: linux_amd64 | |
| npm_config_arch: x64 | |
| - vsce_target: linux-arm64 | |
| ls_target: linux_arm64 | |
| npm_config_arch: arm64 | |
| - vsce_target: linux-armhf | |
| ls_target: linux_arm | |
| npm_config_arch: arm | |
| - vsce_target: darwin-x64 | |
| ls_target: darwin_amd64 | |
| npm_config_arch: x64 | |
| - vsce_target: darwin-arm64 | |
| ls_target: darwin_arm64 | |
| npm_config_arch: arm64 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: "npm" | |
| registry-url: "https://npm.pkg.github.com" | |
| - run: npm install | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| npm_config_arch: ${{ matrix.npm_config_arch }} | |
| ls_target: ${{ matrix.ls_target }} | |
| - name: Create a package.json that actions/upload will like | |
| run: | | |
| cp package.json package.json.real | |
| sed --regexp-extended '/"name"\s*:/ s#@[a-zA-Z\\-]+/##' package.json.real > package.json | |
| - name: Insert Variables | |
| run: | | |
| ./.github/workflow_scripts/insert-secrets.sh | |
| env: | |
| AMPLITUDE_API_KEY: ${{ secrets.AMPLITUDE_API_KEY }} | |
| PARALLELS_CATALOG_URL: ${{ secrets.PARALLELS_CATALOG_URL }} | |
| PARALLELS_CATALOG_BUSINESS_PASSWORD: ${{ secrets.PARALLELS_CATALOG_BUSINESS_PASSWORD }} | |
| PARALLELS_CATALOG_BUSINESS_USER: ${{ secrets.PARALLELS_CATALOG_BUSINESS_USER }} | |
| PARALLELS_CATALOG_PRO_PASSWORD: ${{ secrets.PARALLELS_CATALOG_PRO_PASSWORD }} | |
| PARALLELS_CATALOG_PRO_USER: ${{ secrets.PARALLELS_CATALOG_PRO_USER }} | |
| - run: npm ci | |
| env: | |
| npm_config_arch: ${{ matrix.npm_config_arch }} | |
| ls_target: ${{ matrix.ls_target }} | |
| - name: Package Stable VSIX | |
| run: npm run package -- --target=${{ matrix.vsce_target }} | |
| - name: Upload vsix as artifact | |
| uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 | |
| with: | |
| name: ${{ matrix.vsce_target }} | |
| path: "*.vsix" | |
| - name: Restore old package.json | |
| run: mv package.json.real package.json | |
| release-win: | |
| name: Release extension v${{ needs.check-version-change.outputs.version }} for ${{ matrix.vsce_target }} | |
| needs: | |
| - check-version-change | |
| if: ${{ needs.check-version-change.outputs.changed == 'true' }} | |
| runs-on: windows-latest | |
| permissions: | |
| contents: write | |
| packages: read | |
| env: | |
| EXT_VERSION: ${{ needs.check-version-change.outputs.version }} | |
| strategy: | |
| matrix: | |
| include: | |
| - vsce_target: win32-x64 | |
| ls_target: windows_amd64 | |
| npm_config_arch: x64 | |
| - vsce_target: win32-arm64 | |
| ls_target: windows_arm64 | |
| npm_config_arch: arm64 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: "npm" | |
| registry-url: "https://npm.pkg.github.com" | |
| - name: create a package.json that actions/upload will like | |
| run: | | |
| cp package.json package.json.real | |
| sed --regexp-extended '/"name"\s*:/ s#@[a-zA-Z\\-]+/##' package.json.real > package.json | |
| - name: Install dependencies | |
| run: | | |
| npm ci | |
| env: | |
| npm_config_arch: ${{ matrix.npm_config_arch }} | |
| ls_target: ${{ matrix.ls_target }} | |
| - name: Package stable VSIX | |
| run: npm run package -- --target=${{ matrix.vsce_target }} | |
| - name: Upload vsix as artifact | |
| uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3 | |
| with: | |
| name: ${{ matrix.vsce_target }} | |
| path: "*.vsix" | |
| - name: Restore old package.json | |
| run: | | |
| del package.json | |
| move package.json.real package.json | |
| create-release: | |
| name: Create release v${{ needs.check-version-change.outputs.version }} | |
| needs: | |
| - release | |
| - release-win | |
| - check-version-change | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| packages: read | |
| env: | |
| EXT_VERSION: ${{ needs.check-version-change.outputs.version }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 | |
| - name: Generate release notes | |
| run: | | |
| ./.github/workflow_scripts/get-latest-changelog.sh --output-to-file | |
| cat release_notes.md | |
| - name: Create release and upload release asset | |
| uses: actions/github-script@v6 | |
| with: | |
| script: | | |
| const fs = require("fs"); | |
| const release = await github.rest.repos.createRelease({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| body: fs.readFileSync("release_notes.md", "utf8"), | |
| tag_name: "v${{ env.EXT_VERSION }}", | |
| name: "v${{ env.EXT_VERSION }}", | |
| draft: false, | |
| prerelease: false | |
| }); | |
| upload-artifacts-to-release: | |
| name: Upload artifacts to release v${{ needs.check-version-change.outputs.version }} | |
| needs: | |
| - create-release | |
| - check-version-change | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| packages: read | |
| strategy: | |
| matrix: | |
| include: | |
| - vsce_target: web | |
| ls_target: web_noop | |
| npm_config_arch: x64 | |
| - vsce_target: win32-x64 | |
| ls_target: windows_amd64 | |
| npm_config_arch: x64 | |
| - vsce_target: win32-arm64 | |
| ls_target: windows_arm64 | |
| npm_config_arch: arm | |
| - vsce_target: linux-x64 | |
| ls_target: linux_amd64 | |
| npm_config_arch: x64 | |
| - vsce_target: linux-arm64 | |
| ls_target: linux_arm64 | |
| npm_config_arch: arm64 | |
| - vsce_target: linux-armhf | |
| ls_target: linux_arm | |
| npm_config_arch: arm | |
| - vsce_target: darwin-x64 | |
| ls_target: darwin_amd64 | |
| npm_config_arch: x64 | |
| - vsce_target: darwin-arm64 | |
| ls_target: darwin_arm64 | |
| npm_config_arch: arm64 | |
| env: | |
| EXT_VERSION: ${{ needs.check-version-change.outputs.version }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: ${{ matrix.vsce_target }} | |
| - name: Upload artifact to release | |
| env: | |
| GH_TOKEN: ${{ secrets.GHUB_PAT }} | |
| run: | | |
| ls -la | |
| gh release upload v${{ env.EXT_VERSION }} *.vsix | |
| - name: Create release and upload release asset | |
| if: false | |
| uses: actions/github-script@v6 | |
| with: | |
| script: | | |
| const fs = require("fs"); | |
| const path = "./parallels-desktop-${{ matrix.vsce_target }}-${{ env.EXT_VERSION }}.vsix"; | |
| await github.rest.repos.uploadReleaseAsset({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| release_id: release.data.id, | |
| data: fs.readFileSync(path), | |
| name: "parallels-desktop-${{ matrix.vsce_target }}-${{ env.EXT_VERSION }}.vsix", | |
| headers: { | |
| "content-type": "application/vsix", | |
| "content-length": fs.statSync(path).size | |
| } | |
| }); | |
| core.summary.addLink(`Release v${{ env.EXT_VERSION }}`, release.data.html_url); | |
| await core.summary.write(); | |
| publish: | |
| name: Publish extension v${{ needs.check-version-change.outputs.version }} | |
| # environment: publish | |
| needs: | |
| - check-version-change | |
| - upload-artifacts-to-release | |
| runs-on: ubuntu-latest | |
| permissions: {} | |
| env: | |
| EXT_VERSION: ${{ needs.check-version-change.outputs.version }} | |
| steps: | |
| - uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 | |
| - name: Publish Stable to Marketplace | |
| run: npx vsce publish --no-git-tag-version --packagePath $(find . -iname *.vsix) | |
| env: | |
| VSCE_PAT: ${{ secrets.PUBLISHER_KEY }} | |
| publish-open-vsx: | |
| name: Publish to Open VSX v${{ needs.check-version-change.outputs.version }} | |
| needs: | |
| - check-version-change | |
| - upload-artifacts-to-release | |
| runs-on: ubuntu-latest | |
| permissions: {} | |
| env: | |
| EXT_VERSION: ${{ needs.check-version-change.outputs.version }} | |
| steps: | |
| - uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7 | |
| - name: Publish to Open VSX | |
| run: | | |
| set -euo pipefail | |
| echo "Searching for .vsix artifacts to publish..." | |
| mapfile -t files < <(find . -type f -iname "*.vsix" -print) | |
| if [ ${#files[@]} -eq 0 ]; then | |
| echo "No .vsix files found to publish." | |
| exit 0 | |
| fi | |
| for f in "${files[@]}"; do | |
| echo "Publishing: $f" | |
| npx --yes ovsx publish "$f" -p "$OPEN_VSX_TOKEN" | |
| done | |
| env: | |
| OPEN_VSX_TOKEN: ${{ secrets.OPEN_VSX_TOKEN }} | |
| discord-announce: | |
| needs: | |
| - publish | |
| - publish-open-vsx | |
| - check-version-change | |
| name: Announce on Discord | |
| runs-on: ubuntu-latest | |
| env: | |
| DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | |
| VERSION: ${{ needs.check-version-change.outputs.version }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Announce on discord | |
| id: announce_discord | |
| run: | | |
| ./.github/workflow_scripts/announce_discord.sh --repo ${{ github.repository }} --webhook-url $DISCORD_WEBHOOK --version ${{ env.VERSION }} | |
| env: | |
| SLACK_WEBHOOKS: ${{ env.DISCORD_WEBHOOK }} |