Skip to content

Add release workflow #1

Add release workflow

Add release workflow #1

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 }}