-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5ac4457
commit 74bffeb
Showing
1 changed file
with
11 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
name: 'Release and Build' | ||
description: 'Build the project, commit changes, create a new release, and tag it' | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
|
@@ -11,7 +10,7 @@ on: | |
draft: | ||
description: "Draft" | ||
required: true | ||
default: false | ||
default: true | ||
type: boolean | ||
version-increment-type: | ||
description: 'Which part of the version to increment:' | ||
|
@@ -22,6 +21,9 @@ on: | |
- minor | ||
- patch | ||
default: 'patch' | ||
push: | ||
branches: | ||
- release-workflow # Add this | ||
permissions: | ||
contents: write | ||
jobs: | ||
|
@@ -47,10 +49,10 @@ jobs: | |
id: prepare_release | ||
uses: DevCycleHQ/release-action/[email protected] | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
version-increment-type: ${{ inputs.version-increment-type }} | ||
prerelease: ${{ inputs.prerelease }} | ||
draft: ${{ inputs.draft }} | ||
github-token: ${{ secrets.AUTOMATION_USER_TOKEN }} | ||
version-increment-type: ${{ github.event.inputs.version-increment-type || 'patch' }} | ||
prerelease: ${{ github.event.inputs.prerelease }} | ||
draft: ${{ github.event.inputs.draft }} | ||
- name: Commit version change | ||
run: | | ||
git config --global user.email "[email protected]" | ||
|
@@ -59,7 +61,7 @@ jobs: | |
git commit -m "Release ${{steps.prepare_release.outputs.next-release-tag}}" | ||
- name: Push version change | ||
run: | | ||
git push origin HEAD:main | ||
git push origin HEAD:release-workflow # Change this to your test branch name | ||
if: inputs.draft != true | ||
- name: Create Release | ||
id: create_release | ||
|
@@ -68,14 +70,6 @@ jobs: | |
tag: ${{ steps.prepare_release.outputs.next-release-tag }} | ||
target: ${{ github.sha }} | ||
changelog: ${{ steps.prepare_release.outputs.changelog }} | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
github-token: ${{ secrets.AUTOMATION_USER_TOKEN }} | ||
prerelease: ${{ inputs.prerelease }} | ||
draft: ${{ inputs.draft }} | ||
|
||
outputs: | ||
release-tag: | ||
description: 'Tag used for the release' | ||
value: ${{ steps.prepare_release.outputs.next-release-tag }} | ||
release-url: | ||
description: 'URL of the created release' | ||
value: ${{ steps.create_release.outputs.release-url }} | ||
draft: ${{ inputs.draft }} |