Merge pull request #213 from infracost/chore/bump-version-0.2.24 #62
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*" | |
permissions: | |
contents: write | |
jobs: | |
build: | |
name: Release | |
strategy: | |
matrix: | |
include: | |
- vsce_target: win32-x64 | |
bin_target: windows-amd64 | |
npm_config_arch: x64 | |
- vsce_target: win32-arm64 | |
bin_target: windows-arm64 | |
npm_config_arch: arm | |
- vsce_target: linux-x64 | |
bin_target: linux-amd64 | |
npm_config_arch: x64 | |
- vsce_target: linux-arm64 | |
bin_target: linux-arm64 | |
npm_config_arch: arm64 | |
- vsce_target: darwin-x64 | |
bin_target: darwin-amd64 | |
npm_config_arch: x64 | |
- vsce_target: darwin-arm64 | |
bin_target: darwin-arm64 | |
npm_config_arch: arm64 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "16.13.1" | |
- name: Setup Environment | |
run: node -e "console.log('PACKAGE_VERSION=' + require('./package.json').version + '\nPACKAGE_NAME=' + require('./package.json').name + '-' + require('./package.json').version)" >> $GITHUB_ENV | |
- name: Verify versions | |
run: node -e "if ('refs/tags/v' + '${{ env.PACKAGE_VERSION }}' !== '${{ github.ref }}') { console.log('::error' + 'Version Mismatch. refs/tags/v' + '${{ env.PACKAGE_VERSION }}', '${{ github.ref }}'); throw Error('Version Mismatch')} " | |
- name: Install | |
run: yarn | |
env: | |
npm_config_arch: ${{ matrix.npm_config_arch }} | |
- name: Package extension | |
run: yarn vscode:package -- --target=${{ matrix.vsce_target }} | |
env: | |
INFRACOST_BIN_TARGET: ${{ matrix.bin_target }} | |
- name: Upload vsix as artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.vsce_target }} | |
path: "*.vsix" | |
publish: | |
name: Publish All | |
runs-on: ubuntu-latest | |
needs: build | |
if: success() && startsWith( github.ref, 'refs/tags/v') | |
steps: | |
- uses: actions/download-artifact@v3 | |
- name: Publish Extension | |
run: npx vsce publish --yarn --packagePath $(find . -iname *.vsix) -p ${{ secrets.MARKETPLACE_PAT }} | |
- name: Create GitHub release | |
id: create_release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: "*.vsix" | |
tag_name: ${{ github.ref }} | |
name: v${{ env.PACKAGE_VERSION }} | |
draft: true | |
generate_release_notes: true | |
prerelease: false |