Run Gitea release pipeline from tag environment
This commit is contained in:
@@ -33,7 +33,6 @@ jobs:
|
|||||||
|
|
||||||
build-client-windows:
|
build-client-windows:
|
||||||
needs: validate-client
|
needs: validate-client
|
||||||
if: startsWith(github.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch' && inputs.build_windows == 'true')
|
|
||||||
# .NET can publish a self-contained Windows x64 client from Linux.
|
# .NET can publish a self-contained Windows x64 client from Linux.
|
||||||
# This keeps releases independent of a Windows Gitea runner.
|
# This keeps releases independent of a Windows Gitea runner.
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
@@ -52,10 +51,14 @@ jobs:
|
|||||||
./build/build-client-package.ps1
|
./build/build-client-package.ps1
|
||||||
|
|
||||||
- name: Build release manifest for tags
|
- name: Build release manifest for tags
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
$tag = "${{ github.ref_name }}"
|
$ref = if ($env:GITHUB_REF) { $env:GITHUB_REF } else { $env:GITEA_REF }
|
||||||
|
if ($ref -notlike "refs/tags/v*") {
|
||||||
|
Write-Host "Not a version tag; skipping release manifest."
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
$tag = Split-Path -Leaf $ref
|
||||||
$artifactUrl = "https://gitea.officecom.cloud/officecom/oc-sentinel/releases/download/$tag/OCSentinelClient-win-x64.zip"
|
$artifactUrl = "https://gitea.officecom.cloud/officecom/oc-sentinel/releases/download/$tag/OCSentinelClient-win-x64.zip"
|
||||||
./build/build-release-manifest.ps1 -ArtifactUrl $artifactUrl
|
./build/build-release-manifest.ps1 -ArtifactUrl $artifactUrl
|
||||||
|
|
||||||
@@ -70,13 +73,22 @@ jobs:
|
|||||||
if-no-files-found: warn
|
if-no-files-found: warn
|
||||||
|
|
||||||
- name: Publish Gitea release assets
|
- name: Publish Gitea release assets
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
|
$ref = if ($env:GITHUB_REF) { $env:GITHUB_REF } else { $env:GITEA_REF }
|
||||||
|
if ($ref -notlike "refs/tags/v*") {
|
||||||
|
Write-Host "Not a version tag; skipping Gitea release publication."
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
$headers = @{ Authorization = "token $env:GITEA_TOKEN" }
|
$headers = @{ Authorization = "token $env:GITEA_TOKEN" }
|
||||||
$repository = $env:GITEA_REPOSITORY
|
$repository = if ($env:GITEA_REPOSITORY) { $env:GITEA_REPOSITORY } else { $env:GITHUB_REPOSITORY }
|
||||||
$baseUrl = "$env:GITEA_SERVER_URL/api/v1/repos/$repository"
|
$serverUrl = if ($env:GITEA_SERVER_URL) { $env:GITEA_SERVER_URL } else { $env:GITHUB_SERVER_URL }
|
||||||
$tag = "${{ github.ref_name }}"
|
if ([string]::IsNullOrWhiteSpace($env:GITEA_TOKEN) -or [string]::IsNullOrWhiteSpace($repository) -or [string]::IsNullOrWhiteSpace($serverUrl)) {
|
||||||
|
throw "Gitea release environment is incomplete. Expected GITEA_TOKEN, repository, and server URL."
|
||||||
|
}
|
||||||
|
$baseUrl = "$serverUrl/api/v1/repos/$repository"
|
||||||
|
$tag = Split-Path -Leaf $ref
|
||||||
$releaseBody = @{
|
$releaseBody = @{
|
||||||
tag_name = $tag
|
tag_name = $tag
|
||||||
target_commitish = "${{ github.sha }}"
|
target_commitish = "${{ github.sha }}"
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<RootNamespace>OCSentinelCli</RootNamespace>
|
<RootNamespace>OCSentinelCli</RootNamespace>
|
||||||
<Product>OfficeCom Sentinel</Product>
|
<Product>OfficeCom Sentinel</Product>
|
||||||
<Company>OfficeCom</Company>
|
<Company>OfficeCom</Company>
|
||||||
<Version>1.2.6</Version>
|
<Version>1.2.7</Version>
|
||||||
<AssemblyVersion>1.2.3.0</AssemblyVersion>
|
<AssemblyVersion>1.2.3.0</AssemblyVersion>
|
||||||
<FileVersion>1.2.3.0</FileVersion>
|
<FileVersion>1.2.3.0</FileVersion>
|
||||||
<InformationalVersion>1.2.3</InformationalVersion>
|
<InformationalVersion>1.2.3</InformationalVersion>
|
||||||
|
|||||||
Reference in New Issue
Block a user