-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
83 additions
and
32 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,33 @@ | ||
name: Update examples version | ||
|
||
on: | ||
repository_dispatch: | ||
types: [ update-examples ] | ||
|
||
defaults: | ||
run: | ||
shell: pwsh | ||
|
||
jobs: | ||
update-examples-version: | ||
if: ${{ github.event_name == 'repository_dispatch' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.PUSH_GITHUB_TOKEN }} | ||
- run: | | ||
$oldTag = "${{ github.event.client_payload.oldTag }}" | ||
$newTag = "${{ github.event.client_payload.newTag }}" | ||
. .\update-version.ps1 # Import the functions | ||
dir -r .\docs\**\*.md | % { update-md-files $_ -OldVersion $oldTag -NewVersion $newTag } | ||
dir -r .github\**\*.yml | % { update-md-files $_ -OldVersion $oldTag -NewVersion $newTag } | ||
dir -r .azure\**\*.yml | % { update-md-files $_ -OldVersion $oldTag -NewVersion $newTag } | ||
git add --verbose . | ||
git config user.name 'Artur' | ||
git config user.email 'arturcic@gmail.com' | ||
git commit -m "update examples version to $newTag" --allow-empty | ||
git push --force | ||
name: Update examples version |
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 |
---|---|---|
@@ -1,50 +1,68 @@ | ||
name: release | ||
on: | ||
release: | ||
types: [published] | ||
types: [ published ] | ||
|
||
defaults: | ||
run: | ||
shell: pwsh | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
os: [ ubuntu-latest ] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Fetch all history for all tags and branches | ||
run: | | ||
git fetch --prune --unshallow | ||
- run: | | ||
npm install | ||
npm run build:agent:github | ||
npm run build:agent:azure | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.PUSH_GITHUB_TOKEN }} | ||
- run: | | ||
npm install | ||
npm run build:agent:github | ||
npm run build:agent:azure | ||
# npm run compress:github | ||
# npm run compress:azure | ||
name: Build code | ||
- name: Install GitVersion | ||
uses: ./gitversion/setup | ||
with: | ||
versionSpec: '5.x' | ||
- name: Use GitVersion | ||
id: gitversion # step id used as reference for output values | ||
uses: ./gitversion/execute | ||
- run: | | ||
$date = Get-Date -format "yyMMddHH" | ||
$version = "${{steps.gitversion.outputs.majorMinorPatch}}.$date" | ||
$major = "${{steps.gitversion.outputs.major}}" | ||
$minor = "${{steps.gitversion.outputs.minor}}" | ||
$patch = "${{steps.gitversion.outputs.patch}}" | ||
# npm run compress:github | ||
# npm run compress:azure | ||
name: Build code | ||
- name: Install GitVersion | ||
uses: ./gitversion/setup | ||
with: | ||
versionSpec: '5.x' | ||
- name: Use GitVersion | ||
id: gitversion # step id used as reference for output values | ||
uses: ./gitversion/execute | ||
- run: | | ||
$date = Get-Date -format "yyMMddHH" | ||
$version = "${{steps.gitversion.outputs.majorMinorPatch}}.$date" | ||
$major = "${{steps.gitversion.outputs.major}}" | ||
$minor = "${{steps.gitversion.outputs.minor}}" | ||
$patch = "${{steps.gitversion.outputs.patch}}" | ||
. .\update-version.ps1 # Import the functions | ||
update-manifest .\dist\azure\vss-extension.json -Version $version | ||
dir -r .\dist\**\task.json | % { update-task $_ -Major $major -Minor $minor -Patch $patch } | ||
. .\update-version.ps1 # Import the functions | ||
update-manifest .\dist\azure\vss-extension.json -Version $version | ||
dir -r .\dist\**\task.json | % { update-task $_ -Major $major -Minor $minor -Patch $patch } | ||
npm run publish:azure -- --token ${{ secrets.TFX_TOKEN }} | ||
name: Publish Azure extension | ||
- name: Get tags | ||
id: get-tags | ||
shell: pwsh | ||
run: | | ||
# Finding the version from release tag | ||
npm run publish:azure -- --token ${{ secrets.TFX_TOKEN }} | ||
$newTag = "${{steps.gitversion.outputs.majorMinorPatch}}" | ||
$oldTag = $(git describe --abbrev=0 --tags $(git rev-list --tags --skip=1 --max-count=1)).Trim("v") | ||
echo "Old tag: $oldTag" | ||
echo "New tag: $newTag" | ||
name: Publish Azure extension | ||
"oldTag=$oldTag" >> $env:GITHUB_OUTPUT | ||
"newTag=$newTag" >> $env:GITHUB_OUTPUT | ||
- uses: peter-evans/repository-dispatch@v3 | ||
name: Trigger Update Examples version | ||
with: | ||
token: ${{ secrets.RELEASE_GITHUB_TOKEN }} | ||
repository: ${{ github.repository }} | ||
event-type: update-examples | ||
client-payload: '{"oldTag": "${{ steps.get-tags.outputs.oldTag }}", "newTag": "${{ steps.get-tags.outputs.newTag }}"}' |