Skip to content

Commit

Permalink
#48 - внедрение GitReleaseManager +semver:skip (#87)
Browse files Browse the repository at this point in the history
* #48 - исключение release ветки из Develop Workflow

* #48 - вернул release.yml

* #48 - новый Release Workflow

* fix

* fix

* fix
  • Loading branch information
Stepami authored Aug 11, 2024
1 parent 9f15e48 commit 6279063
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 66 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: Develop Workflow

on:
push:
branches:
- '**'
branches-ignore:
- 'release_test'
pull_request_target:
branches:
- '**'
branches-ignore:
- 'release_test'

permissions:
actions: write
Expand Down
61 changes: 0 additions & 61 deletions .github/workflows/release.txt

This file was deleted.

106 changes: 106 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: Release Workflow

on:
push:
branches:
- 'release_test'

jobs:
create-release:
name: Create release
runs-on: ubuntu-latest
outputs:
determined_version: ${{ steps.version_step.outputs.majorMinorPatch }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.12.0'
- name: Determine Version
id: version_step
uses: gittools/actions/gitversion/[email protected]
with:
useConfigFile: true
- name: Setup GitReleaseManager
uses: gittools/actions/gitreleasemanager/[email protected]
with:
versionSpec: '0.18.x'
- name: Create release with GitReleaseManager
uses: gittools/actions/gitreleasemanager/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
owner: 'Stepami'
repository: 'hydrascript'
milestone: 'v${{ steps.version_step.outputs.majorMinorPatch }}'
name: 'v${{ steps.version_step.outputs.majorMinorPatch }}'

upload-release-assets:
name: Upload release assets
needs: create-release
outputs:
determined_version: ${{ needs.create-release.outputs.determined_version }}
strategy:
matrix:
config:
- os: ubuntu-latest
rid: linux-x64
- os: macos-12
rid: osx-x64
- os: macos-14
rid: osx-arm64
- os: windows-latest
rid: win-x64
runs-on: ${{ matrix.config.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Setup GitReleaseManager
uses: gittools/actions/gitreleasemanager/[email protected]
with:
versionSpec: '0.18.x'
- name: Publish
run: |
mkdir output
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
- name: Rename Executable
run: mv ./output/HydraScript${{ matrix.config.rid == 'win-x64' && '.exe' || '' }} ./output/hydrascript_${{ matrix.config.rid }}${{ matrix.config.rid == 'win-x64' && '.exe' || '' }}
- name: Add asset to a release with GitReleaseManager
uses: gittools/actions/gitreleasemanager/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
owner: 'Stepami'
repository: 'hydrascript'
milestone: 'v${{ needs.create-release.outputs.determined_version }}'
assets: ./output/hydrascript_${{ matrix.config.rid }}${{ matrix.config.rid == 'win-x64' && '.exe' || '' }}

publish-release:
name: Publish release
runs-on: ubuntu-latest
needs: upload-release-assets
steps:
- name: Setup GitReleaseManager
uses: gittools/actions/gitreleasemanager/[email protected]
with:
versionSpec: '0.18.x'
- name: Publish release with GitReleaseManager
uses: gittools/actions/gitreleasemanager/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
owner: 'Stepami'
repository: 'hydrascript'
milestone: 'v${{ needs.upload-release-assets.outputs.determined_version }}'
- name: Close release with GitReleaseManager
uses: gittools/actions/gitreleasemanager/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
owner: 'Stepami'
repository: 'hydrascript'
milestone: 'v${{ needs.upload-release-assets.outputs.determined_version }}'
2 changes: 1 addition & 1 deletion ExtendedJavaScriptSubset.sln
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Workflows", "Workflows", "{C7773DC6-9052-4F69-B947-CBFD5D663E80}"
ProjectSection(SolutionItems) = preProject
.github\workflows\develop.yml = .github\workflows\develop.yml
.github\workflows\release.txt = .github\workflows\release.txt
.github\workflows\release.yml = .github\workflows\release.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "IssueTemplate", "IssueTemplate", "{0E31199C-4893-4920-A356-D1FF7850BFAD}"
Expand Down

0 comments on commit 6279063

Please sign in to comment.