Skip to content

Commit 6279063

Browse files
authored
#48 - внедрение GitReleaseManager +semver:skip (#87)
* #48 - исключение release ветки из Develop Workflow * #48 - вернул release.yml * #48 - новый Release Workflow * fix * fix * fix
1 parent 9f15e48 commit 6279063

File tree

4 files changed

+111
-66
lines changed

4 files changed

+111
-66
lines changed

.github/workflows/develop.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ name: Develop Workflow
22

33
on:
44
push:
5-
branches:
6-
- '**'
5+
branches-ignore:
6+
- 'release_test'
77
pull_request_target:
8-
branches:
9-
- '**'
8+
branches-ignore:
9+
- 'release_test'
1010

1111
permissions:
1212
actions: write

.github/workflows/release.txt

Lines changed: 0 additions & 61 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: Release Workflow
2+
3+
on:
4+
push:
5+
branches:
6+
- 'release_test'
7+
8+
jobs:
9+
create-release:
10+
name: Create release
11+
runs-on: ubuntu-latest
12+
outputs:
13+
determined_version: ${{ steps.version_step.outputs.majorMinorPatch }}
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
- name: Setup GitVersion
20+
uses: gittools/actions/gitversion/setup@v3.0.0
21+
with:
22+
versionSpec: '5.12.0'
23+
- name: Determine Version
24+
id: version_step
25+
uses: gittools/actions/gitversion/execute@v3.0.0
26+
with:
27+
useConfigFile: true
28+
- name: Setup GitReleaseManager
29+
uses: gittools/actions/gitreleasemanager/setup@v3.0.0
30+
with:
31+
versionSpec: '0.18.x'
32+
- name: Create release with GitReleaseManager
33+
uses: gittools/actions/gitreleasemanager/create@v3.0.0
34+
with:
35+
token: ${{ secrets.GITHUB_TOKEN }}
36+
owner: 'Stepami'
37+
repository: 'hydrascript'
38+
milestone: 'v${{ steps.version_step.outputs.majorMinorPatch }}'
39+
name: 'v${{ steps.version_step.outputs.majorMinorPatch }}'
40+
41+
upload-release-assets:
42+
name: Upload release assets
43+
needs: create-release
44+
outputs:
45+
determined_version: ${{ needs.create-release.outputs.determined_version }}
46+
strategy:
47+
matrix:
48+
config:
49+
- os: ubuntu-latest
50+
rid: linux-x64
51+
- os: macos-12
52+
rid: osx-x64
53+
- os: macos-14
54+
rid: osx-arm64
55+
- os: windows-latest
56+
rid: win-x64
57+
runs-on: ${{ matrix.config.os }}
58+
steps:
59+
- name: Checkout
60+
uses: actions/checkout@v4
61+
- name: Setup .NET
62+
uses: actions/setup-dotnet@v4
63+
with:
64+
dotnet-version: 8.0.x
65+
- name: Setup GitReleaseManager
66+
uses: gittools/actions/gitreleasemanager/setup@v3.0.0
67+
with:
68+
versionSpec: '0.18.x'
69+
- name: Publish
70+
run: |
71+
mkdir output
72+
dotnet publish ./src/HydraScript/HydraScript.csproj -c Release -r ${{ matrix.config.rid }} -p:PublishSingleFile=true -p:DebugType=embedded -p:Version=${{ needs.create-release.outputs.determined_version }} --self-contained false -o ./output
73+
- name: Rename Executable
74+
run: mv ./output/HydraScript${{ matrix.config.rid == 'win-x64' && '.exe' || '' }} ./output/hydrascript_${{ matrix.config.rid }}${{ matrix.config.rid == 'win-x64' && '.exe' || '' }}
75+
- name: Add asset to a release with GitReleaseManager
76+
uses: gittools/actions/gitreleasemanager/addasset@v3.0.0
77+
with:
78+
token: ${{ secrets.GITHUB_TOKEN }}
79+
owner: 'Stepami'
80+
repository: 'hydrascript'
81+
milestone: 'v${{ needs.create-release.outputs.determined_version }}'
82+
assets: ./output/hydrascript_${{ matrix.config.rid }}${{ matrix.config.rid == 'win-x64' && '.exe' || '' }}
83+
84+
publish-release:
85+
name: Publish release
86+
runs-on: ubuntu-latest
87+
needs: upload-release-assets
88+
steps:
89+
- name: Setup GitReleaseManager
90+
uses: gittools/actions/gitreleasemanager/setup@v3.0.0
91+
with:
92+
versionSpec: '0.18.x'
93+
- name: Publish release with GitReleaseManager
94+
uses: gittools/actions/gitreleasemanager/publish@v3.0.0
95+
with:
96+
token: ${{ secrets.GITHUB_TOKEN }}
97+
owner: 'Stepami'
98+
repository: 'hydrascript'
99+
milestone: 'v${{ needs.upload-release-assets.outputs.determined_version }}'
100+
- name: Close release with GitReleaseManager
101+
uses: gittools/actions/gitreleasemanager/close@v3.0.0
102+
with:
103+
token: ${{ secrets.GITHUB_TOKEN }}
104+
owner: 'Stepami'
105+
repository: 'hydrascript'
106+
milestone: 'v${{ needs.upload-release-assets.outputs.determined_version }}'

ExtendedJavaScriptSubset.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ EndProject
2424
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Workflows", "Workflows", "{C7773DC6-9052-4F69-B947-CBFD5D663E80}"
2525
ProjectSection(SolutionItems) = preProject
2626
.github\workflows\develop.yml = .github\workflows\develop.yml
27-
.github\workflows\release.txt = .github\workflows\release.txt
27+
.github\workflows\release.yml = .github\workflows\release.yml
2828
EndProjectSection
2929
EndProject
3030
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "IssueTemplate", "IssueTemplate", "{0E31199C-4893-4920-A356-D1FF7850BFAD}"

0 commit comments

Comments
 (0)