|
@@ -29,7 +29,7 @@ jobs:
|
|
|
REPO_SELF: ${{ vars.REPO_SELF }}
|
|
REPO_SELF: ${{ vars.REPO_SELF }}
|
|
|
APP_PATH: "applications_user/subbrute"
|
|
APP_PATH: "applications_user/subbrute"
|
|
|
RELATIVE_PATH: "applications/external/subbrute"
|
|
RELATIVE_PATH: "applications/external/subbrute"
|
|
|
- RELEASE_VERSION: ""
|
|
|
|
|
|
|
+ PREV_TAG: ""
|
|
|
APP_NAME: ""
|
|
APP_NAME: ""
|
|
|
ZIP_NAME: ""
|
|
ZIP_NAME: ""
|
|
|
ZIP_TAG: ""
|
|
ZIP_TAG: ""
|
|
@@ -37,6 +37,7 @@ jobs:
|
|
|
TGZ_TAG: ""
|
|
TGZ_TAG: ""
|
|
|
SHA: ""
|
|
SHA: ""
|
|
|
FW_VERSION: ""
|
|
FW_VERSION: ""
|
|
|
|
|
+ RELEASE_VERSION: ""
|
|
|
strategy:
|
|
strategy:
|
|
|
fail-fast: false
|
|
fail-fast: false
|
|
|
matrix:
|
|
matrix:
|
|
@@ -100,30 +101,35 @@ jobs:
|
|
|
$sha = (git rev-parse --verify HEAD)
|
|
$sha = (git rev-parse --verify HEAD)
|
|
|
|
|
|
|
|
$releaseVersion = ''
|
|
$releaseVersion = ''
|
|
|
|
|
+ $latestTag = ((gh release view --json tagName,url -R ${{ vars.REPO_SELF }}) | ConvertFrom-Json ).tagName
|
|
|
|
|
|
|
|
- if ( [string]::IsNullOrWhitespace($env:INPUT_VERSION) ) {
|
|
|
|
|
- $latestTag = ((gh release view --json tagName,url -R ${{ vars.REPO_SELF }}) | ConvertFrom-Json ).tagName
|
|
|
|
|
|
|
+ if ( [string]::IsNullOrWhitespace($env:INPUT_VERSION) ) {
|
|
|
Write-Output "::notice title=Latest tag::$latestTag"
|
|
Write-Output "::notice title=Latest tag::$latestTag"
|
|
|
|
|
|
|
|
$lastIndex = $latestTag.LastIndexOf('.')
|
|
$lastIndex = $latestTag.LastIndexOf('.')
|
|
|
|
|
|
|
|
$minorValue = $latestTag.Substring($latestTag.LastIndexOf('.') + 1)
|
|
$minorValue = $latestTag.Substring($latestTag.LastIndexOf('.') + 1)
|
|
|
$minorValue = [Convert]::ToInt32($minorValue) + 1
|
|
$minorValue = [Convert]::ToInt32($minorValue) + 1
|
|
|
- $latestTag = $latestTag.Substring(0, $lastIndex)
|
|
|
|
|
|
|
+ $newTag = $latestTag.Substring(0, $lastIndex)
|
|
|
|
|
|
|
|
- $releaseVersion = ('{0}.{1}' -f $latestTag, $minorValue)
|
|
|
|
|
|
|
+ $releaseVersion = ('{0}.{1}' -f $newTag, $minorValue)
|
|
|
} else {
|
|
} else {
|
|
|
$releaseVersion = "$env:INPUT_VERSION"
|
|
$releaseVersion = "$env:INPUT_VERSION"
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Write-Output "::notice title=Obtain Version Number::$releaseVersion"
|
|
|
|
|
if ( $releaseVersion.StartsWith('v') ) {
|
|
if ( $releaseVersion.StartsWith('v') ) {
|
|
|
$releaseVersion = $releaseVersion.Substring(1)
|
|
$releaseVersion = $releaseVersion.Substring(1)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ Write-Output "::notice title=RELEASE_VERSION::$releaseVersion"
|
|
|
|
|
+ Write-Output "::notice title=SHA::$sha"
|
|
|
|
|
+ Write-Output "::notice title=FW_VERSION::$fwInfo.tagName"
|
|
|
|
|
+ Write-Output "::notice title=PREV_TAG::$latestTag"
|
|
|
|
|
+
|
|
|
Write-Output ('RELEASE_VERSION={0}' -f $releaseVersion) >> $env:GITHUB_ENV
|
|
Write-Output ('RELEASE_VERSION={0}' -f $releaseVersion) >> $env:GITHUB_ENV
|
|
|
Write-Output ('SHA={0}' -f $sha) >> $env:GITHUB_ENV
|
|
Write-Output ('SHA={0}' -f $sha) >> $env:GITHUB_ENV
|
|
|
Write-Output ('FW_VERSION={0}' -f $fwInfo.tagName) >> $env:GITHUB_ENV
|
|
Write-Output ('FW_VERSION={0}' -f $fwInfo.tagName) >> $env:GITHUB_ENV
|
|
|
|
|
+ Write-Output ('PREV_TAG={0}' -f $latestTag) >> $env:GITHUB_ENV
|
|
|
|
|
|
|
|
- name: Build Firmware
|
|
- name: Build Firmware
|
|
|
shell: bash
|
|
shell: bash
|
|
@@ -229,7 +235,8 @@ jobs:
|
|
|
$json = (gh api -H $mime -H $api /repos/${{ github.REPOSITORY }}/releases) | ConvertFrom-Json
|
|
$json = (gh api -H $mime -H $api /repos/${{ github.REPOSITORY }}/releases) | ConvertFrom-Json
|
|
|
$tagExists = ($json.GetEnumerator() | Where-Object { $_.tag_name -eq 'v${{ env.RELEASE_VERSION }}' }) -ne $null
|
|
$tagExists = ($json.GetEnumerator() | Where-Object { $_.tag_name -eq 'v${{ env.RELEASE_VERSION }}' }) -ne $null
|
|
|
if ( $tagExists -eq $false ) {
|
|
if ( $tagExists -eq $false ) {
|
|
|
- gh api --method POST -H $mime -H $api /repos/${{ github.REPOSITORY }}/releases -f tag_name='v${{ env.RELEASE_VERSION }}' -f target_commitish='${{ env.SHA }}' -f name='v${{ env.RELEASE_VERSION }}' -F draft=true -F prerelease=false -F generate_release_notes=true
|
|
|
|
|
|
|
+ gh api --method POST -H $mime -H $api /repos/${{ github.REPOSITORY }}/releases -f tag_name='v${{ env.RELEASE_VERSION }}' -f target_commitish='${{ env.SHA }}' -f name='v${{ env.RELEASE_VERSION }}' -F draft=true -F prerelease=false -F generate_release_notes=false
|
|
|
|
|
+ gh api --method POST -H $mime -H $api /repos/${{ github.REPOSITORY }}/releases/generate-notes -f tag_name='v${{ env.RELEASE_VERSION }}' -f target_commitish='${{ env.SHA }}' -f previous_tag_name='${{ env.PREV_TAG }}'
|
|
|
}
|
|
}
|
|
|
gh release upload 'v${{ env.RELEASE_VERSION }}' '${{ env.ZIP_NAME }}#${{ env.ZIP_TAG }}' '${{ env.TGZ_NAME }}#${{ env.TGZ_TAG }}' --clobber -R ${{ env.REPO_SELF }}
|
|
gh release upload 'v${{ env.RELEASE_VERSION }}' '${{ env.ZIP_NAME }}#${{ env.ZIP_TAG }}' '${{ env.TGZ_NAME }}#${{ env.TGZ_TAG }}' --clobber -R ${{ env.REPO_SELF }}
|
|
|
gh release edit 'v${{ env.RELEASE_VERSION }}' --draft=false -R ${{ env.REPO_SELF }}
|
|
gh release edit 'v${{ env.RELEASE_VERSION }}' --draft=false -R ${{ env.REPO_SELF }}
|