-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrelease.yml
More file actions
82 lines (78 loc) · 2.8 KB
/
release.yml
File metadata and controls
82 lines (78 loc) · 2.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Create a new stable release of Bad Echo software.
# To configure this workflow, replace variables with their correct values in the workflow-scoped env map.
name: Create Stable Release
on:
workflow_dispatch:
inputs:
component-to-increment:
description: Version Component to Increment
required: true
type: choice
options:
- Major
- Minor
- Patch
env:
PRODUCT_NAME: Bad Echo Software # Replace with the software product being published. Appears in the release tag commit message.
LAST_RUN_CONCLUSION:
jobs:
validate-release:
name: Validate Release Candidate
runs-on: windows-2025-vs2026
steps:
- name: Fail If Not Default Branch
if: github.ref_name != github.event.repository.default_branch
uses: actions/github-script@v7.0.1
with:
script: core.setfailed('Can only create stable releases from the repository\'s default branch.')
- name: Shallow Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Fetch Last CI/CD Run Conclusion
id: check-last-run
run: |
Write-Output "LAST_RUN_CONCLUSION=$(.\build\Get-LatestWorkflowConclusion.ps1 -Repository:$Env:REPOSITORY -Branch:$Env:BRANCH -WorkflowPath:$Env:WORKFLOW_PATH)" >> $Env:GITHUB_ENV
env:
REPOSITORY: ${{ github.repository }}
BRANCH: ${{ github.ref_name }}
WORKFLOW_PATH: .github/workflows/ci.yml
GH_TOKEN: ${{ secrets.REPO_TOKEN }}
- name: Fail If Last Run Unsuccessful
if: env.LAST_RUN_CONCLUSION != 'success'
uses: actions/github-script@v7.0.1
with:
script: core.setFailed('Cannot create a stable release for a commit that resulted in a failed CI/CD run.')
build:
name: Execute Build Workflow
needs: validate-release
uses: ./.github/workflows/ci.yml
with:
release-build: true
skip-tests: true
secrets:
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
create-release:
name: Create Release
needs: [validate-release, build]
runs-on: windows-2025-vs2026
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Download Build Artifact
uses: actions/download-artifact@v4
with:
name: ${{ needs.build.outputs.build-artifact-name }}
path: bin\rel
- name: Setup Git User
run: git config --global user.email "chamber@badecho.com"; git config --global user.name "Echo Chamber"
- name: Create GitHub Release
run: .\build\New-GitHubRelease.ps1 "${{ env.PRODUCT_NAME }}" "${{ github.repository }}"
env:
GH_TOKEN: ${{ secrets.REPO_TOKEN }}
- name: Bump Version
run: .\build\Bump-Version.ps1 ${{ github.event.inputs.component-to-increment }}