forked from GitTools/actions
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request GitTools#1459 from arturcic/feature/reusable-action
Refactor Azure Marketplace publishing into a reusable action
- Loading branch information
Showing
2 changed files
with
57 additions
and
38 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: 'Publish Azure Extension' | ||
description: 'Publish Azure Extension to Marketplace' | ||
inputs: | ||
mode: | ||
description: 'Release mode' | ||
required: true | ||
major: | ||
description: 'Major version' | ||
required: true | ||
minor: | ||
description: 'Minor version' | ||
required: true | ||
patch: | ||
description: 'Patch version' | ||
required: true | ||
token: | ||
description: 'Token for Azure DevOps' | ||
required: true | ||
|
||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Publish Azure extension | ||
shell: pwsh | ||
run: | | ||
$date = Get-Date -format "yyMMddHH" | ||
$mode = "${{ inputs.mode }}" | ||
$major = "${{ inputs.major }}" | ||
$minor = "${{ inputs.minor }}" | ||
$patch = "${{ inputs.patch }}" | ||
$version = "$major.$minor.$patch.$date" | ||
$vsix = "dist/gittools.gittools-$version.vsix" | ||
echo "Release mode: $mode" | ||
echo "Version: $version" | ||
npm run publish:prepare -- --mode $mode --version $version | ||
npm run publish:azure:local -- --env mode=$mode version=$version --output-path $vsix | ||
npm run publish:azure:marketplace -- --token ${{ inputs.token }} --env mode=$mode version=$version | ||
echo "vsix=$vsix" >> $env:GITHUB_OUTPUT |
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