Skip to content

Commit

Permalink
Add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
elendil-software committed Jan 11, 2025
1 parent 07eb5d3 commit cfa5b83
Show file tree
Hide file tree
Showing 4 changed files with 135 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/release-changelog-builder-configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@
{
"title": "## 📦 Dependencies",
"labels": ["dependencies"]
},
{
"title": "## 💬 Other",
"labels": ["other"]
}
],
"ignore_labels": [
"ignore",
"documentation"
],
"pr_template": "- ${{TITLE}} (#${{NUMBER}})"
}
21 changes: 21 additions & 0 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: 'Release'
on:
workflow_dispatch:

jobs:
build:
uses: ./.github/workflows/sw_build.yml
with:
gitversion-config: './.github/GitVersion-Release.yml'
build_installer: true

release:
needs: [build]
uses: ./.github/workflows/sw_tag-release.yml
with:
git_config_user_email: '[email protected]'
git_config_user_name: ${{ github.repository_owner }}
git_tag: ${{needs.build.outputs.SemVer}}
changelog_builder_configuration: './.github/release-changelog-builder-configuration.json'
secrets:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
84 changes: 84 additions & 0 deletions .github/workflows/sw_tag-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: 'Tag & Release (Sub-Workflow)'
on:
workflow_call:
inputs:
git_config_user_email:
description: 'E-mail to put in git config user.email'
required: true
type: string
git_config_user_name:
description: 'E-mail to put in git config user.email'
required: true
type: string
git_tag:
description: 'Git tag to create'
required: true
type: string
artifact_name_in:
description: 'Name of an artifact saved by a previous workflow'
default: 'workflow-share'
required: false
type: string
changelog_builder_configuration:
description: 'Relative path to the configuration.json file for the mikepenz/release-changelog-builder-action'
required: true
type: string
secrets:
SSH_PRIVATE_KEY:
required: true

jobs:
release:
name: 'Create Tag and Release'
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/[email protected]
with:
fetch-depth: 0

- name: 'Download source artifact'
uses: actions/[email protected]
with:
name: ${{ inputs.artifact_name_in }}

#- name: 'Unzip artifact archive'
run: |
7z x ${{ inputs.artifact_name_in }}.7z -o${{ inputs.artifact_name_in }}
rm -f ${{ inputs.artifact_name_in }}.7z
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: 'Create Tag'
run: |
git remote set-url origin [email protected]:$REPOSITORY.git
git config user.name "$USER_NAME"
git config user.email "$EMAIL"
git tag -a $TAG -m "$TAG"
git push --follow-tags
env:
REPOSITORY: ${{ github.repository }}
USER_NAME: ${{ inputs.git_config_user_name }}
EMAIL: ${{ inputs.git_config_user_email }}
TAG: ${{ inputs.git_tag }}

- name: 'Build Changelog'
id: build_changelog
uses: mikepenz/[email protected]
with:
failOnError: true
configuration: '${{ inputs.changelog_builder_configuration }}'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: 'Create Release'
uses: ncipollo/[email protected]
with:
artifactErrorsFailBuild: true
draft: false
body: '${{steps.build_changelog.outputs.changelog}}'
tag: '${{ inputs.git_tag }}'
artifacts: '${{ inputs.artifact_name_in }}/*.exe,${{ inputs.artifact_name_in }}/Changelog_*.md,${{ inputs.artifact_name_in }}/Documentation_*.pdf'
token: ${{ secrets.GITHUB_TOKEN }}
22 changes: 22 additions & 0 deletions MountSend.sln
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,25 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Documentation", "Documentat
README.md = README.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{F141C086-C9F6-4318-B9E6-0B01BB3A0CAF}"
ProjectSection(SolutionItems) = preProject
.github\pr-labeler.yml = .github\pr-labeler.yml
.github\GitVersion.yml = .github\GitVersion.yml
.github\GitVersion-Release.yml = .github\GitVersion-Release.yml
.github\release-changelog-builder-configuration.json = .github\release-changelog-builder-configuration.json
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{72F8571D-56AF-48AF-A5F0-414018F0DAE5}"
ProjectSection(SolutionItems) = preProject
.github\workflows\main.yml = .github\workflows\main.yml
.github\workflows\Pull-Request-Labeler.yml = .github\workflows\Pull-Request-Labeler.yml
.github\workflows\Pull-Request.yml = .github\workflows\Pull-Request.yml
.github\workflows\Pre-Version.yml = .github\workflows\Pre-Version.yml
.github\workflows\Release.yml = .github\workflows\Release.yml
.github\workflows\sw_build.yml = .github\workflows\sw_build.yml
.github\workflows\sw_tag-release.yml = .github\workflows\sw_tag-release.yml
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -34,4 +53,7 @@ Global
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {0687883E-3E64-474A-9BE0-074FDD86A554}
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{72F8571D-56AF-48AF-A5F0-414018F0DAE5} = {F141C086-C9F6-4318-B9E6-0B01BB3A0CAF}
EndGlobalSection
EndGlobal

0 comments on commit cfa5b83

Please sign in to comment.