Skip to content

Release

Release #118

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
tag:
description: 'Dev release tag'
required: true
type: string
dev:
description: 'Is dev build'
required: false
default: true
type: boolean
cliTag:
description: 'Version of the CLI to bundle'
required: false
type: string
workflow_call:
inputs:
tag:
description: 'Dev release tag'
required: true
type: string
dev:
description: 'Is dev build'
required: false
default: true
type: boolean
cliTag:
description: 'Version of the CLI to bundle'
required: false
type: string
jobs:
release:
runs-on: windows-latest
outputs:
CLI_VERSION: ${{ steps.extract_cli_version.outputs.CLI_VERSION }}
steps:
- name: Fetch Sources
uses: actions/checkout@v4
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@1ff57057b5cfdc39105cd07a01d78e9b0ea0c14c #v1.3.1
with:
vs-version: '17.2'
- name: Install wget
run: |
choco install wget --no-progress
# - name: Download CLI
# if: inputs.cliTag
# shell: bash
# run: |
# chmod +x ./.github/scripts/update_cli.sh
# ./.github/scripts/update_cli.sh ${{ inputs.cliTag }}
- name: Tag
shell: bash
run: |
echo ${{ inputs.tag }}
tag=${{ inputs.tag }}
echo "RELEASE_VERSION=${{ inputs.tag }}" >> $GITHUB_ENV
message='${{ inputs.tag }}'
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git tag -a "${tag}" -m "${message}"
git push origin "${tag}"
- name: Increment VSIX version
id: vsix_version
uses: timheuer/vsix-version-stamp@9d38292e99e54046455bb68c6a2b5113d269a7d0 #v2
with:
manifest-file: ast-visual-studio-extension\source.extension.vsixmanifest
version-number: ${{ inputs.tag }}
- name: Restore NuGet packages
run: msbuild -t:restore
- name: Build
run: msbuild .\ast-visual-studio-extension\ast-visual-studio-extension.csproj /p:Configuration=Release /p:DeployExtension=False
- name: Extract CLI version
id: extract_cli_version
run: |
CLI_VERSION=$(./ast-visual-studio-extension/CxWrapper/Resources/cx.exe version | grep -Eo '^[0-9]+\.[0-9]+\.[0-9]+')
echo "CLI version being packed is $CLI_VERSION"
echo "CLI_VERSION=$CLI_VERSION" >> $GITHUB_ENV
echo "::set-output name=CLI_VERSION::$CLI_VERSION"
- name: Create Release
uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 #v0.1.15
with:
tag_name: ${{ inputs.tag }}
prerelease: ${{ inputs.dev }}
generate_release_notes: true
files: '**/Release/ast-visual-studio-extension.vsix'
- name: Publish Release
uses: cezarypiatek/VsixPublisherAction@9c6b58b5955df9901a6e9834be1d0a94cd54aeba #1.0
if: inputs.dev == false
with:
extension-file: '.\ast-visual-studio-extension\bin\Release\ast-visual-studio-extension.vsix'
publish-manifest-file: '.\vs-publish.json'
personal-access-code: ${{ secrets.VS_PUBLISHER_ACCESS_TOKEN }}
notify:
if: inputs.dev == false || inputs.cliTag == 'daniel'
needs: release
uses: Checkmarx/plugins-release-workflow/.github/workflows/release-notify.yml@main
with:
product_name: Visual Studio
release_version: ${{ inputs.tag }}
cli_release_version: ${{ needs.release.outputs.CLI_VERSION }}
release_author: "Phoenix Team"
release_url: https://github.com/Checkmarx/ast-visual-studio-extension/releases/tag/${{ inputs.tag }}
jira_product_name: VISUAL_STUDIO
secrets: inherit