Release #16
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: | |
workflow_dispatch: | |
push: | |
branches: | |
- 'release' | |
env: | |
VERSION: 1.7.${{ github.run_number }} | |
NUGET_REPO_URL: 'https://api.nuget.org/v3/index.json' | |
jobs: | |
VSIX: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Sets environment variables - branch-name | |
uses: nelonoel/[email protected] | |
- name: Sets environment variables - Nerdbank.GitVersioning | |
uses: dotnet/nbgv@master | |
with: | |
setAllVars: true | |
- name: Update Version | |
run: ((Get-Content -Path VSPackage/source.extension.vsixmanifest -Raw) -Replace "1.0.0", "${{ env.VERSION }}") | Set-Content -Path VSPackage/source.extension.vsixmanifest | |
working-directory: src | |
shell: pwsh | |
- name: Restore | |
run: dotnet restore ReswCodeGen.sln | |
working-directory: src | |
- name: Setup MSBuild.exe | |
uses: microsoft/[email protected] | |
- name: Build | |
run: msbuild ReswCodeGen.sln /property:Configuration=Release /t:Rebuild | |
working-directory: src | |
- name: Move build output | |
run: mv src/VSPackage/bin/Release/ResWFileCodeGenerator.vsix ResWFileCodeGenerator-${{ env.VERSION }}.vsix | |
- name: Publish artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Visual Studio Extension | |
path: | | |
*.vsix | |
docs/Marketplace.md | |
- name: Publish VSIX Packages | |
continue-on-error: true | |
run: | | |
$VsixPublisher = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VSSDK\VisualStudioIntegration\Tools\Bin\VsixPublisher.exe" | |
& $VsixPublisher login -personalAccessToken ${{ secrets.MARKETPLACE_PAT }} -publisherName ChristianResmaHelle | |
& $VsixPublisher publish -payload ResWFileCodeGenerator-${{ env.VERSION }}.vsix -publishManifest src/publish-manifest.json -ignoreWarnings 'VSIXValidatorWarning01,VSIXValidatorWarning02' | |
Tag: | |
needs: VSIX | |
runs-on: ubuntu-latest | |
steps: | |
- name: Create tag | |
uses: actions/github-script@v7 | |
with: | |
github-token: ${{ github.token }} | |
script: | | |
github.git.createRef({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
ref: "refs/tags/${{ env.VERSION }}", | |
sha: context.sha | |
}) | |
- name: Create release | |
id: create-release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ env.VERSION }} | |
release_name: v${{ env.VERSION }} | |
draft: true | |
prerelease: false | |
- uses: actions/download-artifact@v4 | |
with: | |
path: artifacts | |
- name: Upload VSIX asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create-release.outputs.upload_url }} | |
asset_path: artifacts/Visual Studio Extension/ResWFileCodeGenerator-${{ env.VERSION }}.vsix | |
asset_name: ResWFileCodeGenerator-${{ env.VERSION }}.vsix | |
asset_content_type: application/zip |