-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
switch release branch to master (#19)
- Loading branch information
1 parent
97b2a50
commit 7f9e6b8
Showing
1 changed file
with
2 additions
and
34 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 |
---|---|---|
|
@@ -17,53 +17,21 @@ jobs: | |
with: | ||
dotnet-version: 5.0.x | ||
|
||
- name: Data gatherer | ||
id: data_gatherer | ||
shell: pwsh | ||
run: | | ||
# Get default branch | ||
$repo = "${{ github.repository }}" | ||
$defaultBranch = Invoke-RestMethod -Method GET -Uri https://api.github.com/repos/$repo | Select-Object -ExpandProperty default_branch | ||
Write-Output "::set-output name=default_branch::$(echo $defaultBranch)" | ||
- name: Conditionals handler | ||
id: conditionals_handler | ||
shell: pwsh | ||
run: | | ||
$defaultBranch = "${{ steps.data_gatherer.outputs.default_branch }}" | ||
$githubRef = "${{ github.ref }}" | ||
$githubEventName = "${{ github.event_name }}" | ||
$isDefaultBranch = 'false' | ||
$isPush = 'false' | ||
$isPushToDefaultBranch = 'false' | ||
if ( $githubRef -like "*$defaultBranch*" ) { | ||
$isDefaultBranch = 'true' | ||
} | ||
if ( $githubEventName -eq 'push' ) { | ||
$isPush = 'true' | ||
} | ||
if ( $githubRef -like "*$defaultBranch*" -and $githubEventName -eq 'push' ) { | ||
$isPushToDefaultBranch = 'true' | ||
} | ||
Write-Output "::set-output name=is_default_branch::$(echo $isDefaultBranch)" | ||
Write-Output "::set-output name=is_push::$(echo $isPush)" | ||
Write-Output "::set-output name=is_push_to_default_branch::$(echo $isPushToDefaultBranch)" | ||
- name: Checkout repository | ||
id: checkout_repo | ||
uses: actions/checkout@v2 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
fetch-depth: 0 | ||
|
||
- if: steps.conditionals_handler.outputs.is_push_to_default_branch == 'true' | ||
- if: github.event_name == 'push' && github.ref == 'refs/heads/master' | ||
name: Bump GH tag | ||
id: tag_generator | ||
uses: mathieudutour/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
default_bump: false | ||
release_branches: ${{ steps.data_gatherer.outputs.default_branch }} | ||
release_branches: master | ||
|
||
- name: Build projects | ||
id: build_projects | ||
|