-
Notifications
You must be signed in to change notification settings - Fork 17
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
Showing
8 changed files
with
126 additions
and
56 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
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Release (Beta) | ||
on: workflow_dispatch | ||
|
||
jobs: | ||
release: | ||
name: "Create beta release" | ||
uses: ./.github/workflows/release.yml | ||
with: | ||
environment: Beta release | ||
type: beta | ||
staging: false | ||
branch: dev | ||
branch_version: beta | ||
pre_release: true | ||
secrets: | ||
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Release (Stable) | ||
on: workflow_dispatch | ||
|
||
jobs: | ||
release: | ||
name: "Create release" | ||
uses: ./.github/workflows/release.yml | ||
with: | ||
environment: Stable release | ||
type: stable | ||
staging: false | ||
branch: main | ||
branch_version: main | ||
pre_release: false | ||
secrets: | ||
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} |
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
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 |
---|---|---|
|
@@ -7,14 +7,29 @@ on: | |
type: string | ||
description: "The release type, must be stable, beta, or alpha." | ||
default: "alpha" | ||
environment: | ||
type: string | ||
description: "The environment to use." | ||
default: "Alpha release" | ||
staging: | ||
type: boolean | ||
description: "Whether the release should be simulated or not." | ||
default: false | ||
branch: | ||
type: string | ||
description: "The branch to release from." | ||
default: "main" | ||
branch_version: | ||
type: string | ||
description: "The branch on unifier-version to bump." | ||
default: "main" | ||
pre_release: | ||
type: boolean | ||
description: "Whether the release should be a pre-release or not." | ||
default: false | ||
environment: | ||
type: string | ||
description: "The environment to release to." | ||
default: "Alpha release" | ||
secrets: | ||
DEPLOY_KEY: | ||
required: true | ||
|
||
permissions: | ||
contents: write | ||
|
@@ -23,29 +38,23 @@ jobs: | |
validate-input: | ||
name: "Validate inputs" | ||
runs-on: ubuntu-latest | ||
environment: ${{ inputs.environment }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ env.BRANCH }} | ||
- name: Set up Python 3.12 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
- name: Validate inputs | ||
run: "python3 ./scripts/validate.py \"${{ toJSON(github.event.inputs) }}\"" | ||
pylint: | ||
name: "Run Pylint" | ||
uses: ./.github/workflows/pylint.yml | ||
run: "python3 ./scripts/validate.py ${{ inputs.type }} ${{ inputs.staging }}" | ||
|
||
create-release: | ||
name: "Create release" | ||
runs-on: ubuntu-latest | ||
needs: [validate-input, pylint] | ||
environment: ${{ inputs.environment }} | ||
needs: [validate-input] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ env.BRANCH }} | ||
ref: ${{ inputs.branch }} | ||
- name: Set up Python 3.12 | ||
uses: actions/setup-python@v5 | ||
with: | ||
|
@@ -58,27 +67,38 @@ jobs: | |
python3 ./scripts/get_version.py | ||
- name: Get release notes | ||
run: | | ||
echo "NOTES=$(python3 ./scripts/get_notes.py '${{ env.VERSION }}')" >> $GITHUB_ENV | ||
{ | ||
echo 'NOTES<<EOF' | ||
python3 ./scripts/get_notes.py '${{ env.VERSION }}' | ||
echo EOF | ||
} >> $GITHUB_ENV | ||
- name: Create GitHub release | ||
uses: elgohr/Github-Release-Action@v5 | ||
uses: ncipollo/[email protected] | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
title: ${{ env.RAW_VERSION }} | ||
name: ${{ env.RAW_VERSION }} | ||
tag: ${{ env.VERSION }} | ||
prerelease: ${{ env.PRE_RELEASE }} | ||
prerelease: ${{ inputs.pre_release }} | ||
body: ${{ env.NOTES }} | ||
commit: ${{ inputs.branch }} | ||
draft: ${{ inputs.staging }} | ||
skipIfReleaseExists: true | ||
publish-release: | ||
name: "Publish release" | ||
runs-on: ubuntu-latest | ||
needs: [create-release] | ||
environment: ${{ inputs.environment }} | ||
if: ${{ !inputs.staging }} | ||
if: ${{ inputs.staging == false }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: 'UnifierHQ/unifier-version' | ||
ref: ${{ env.BRANCH_VERSION }} | ||
ref: ${{ inputs.branch_version }} | ||
token: ${{ secrets.DEPLOY_KEY }} | ||
- name: Download Unifier | ||
run: | | ||
git clone --branch ${{ inputs.branch }} https://github.com/UnifierHQ/unifier | ||
- name: Set up Git config | ||
run: | | ||
git config --global user.name "GitHub Actions" | ||
|
@@ -90,8 +110,40 @@ jobs: | |
- name: Bump version | ||
run: | | ||
python3 ./scripts/bump.py | ||
- name: Delete Unifier | ||
run: | | ||
rm -rf ./unifier | ||
- name: Push to repository | ||
run: | | ||
git add . | ||
git commit -m "Version bump to ${{ env.VERSION }}" | ||
git commit -m "Version bump for release" | ||
git push | ||
publish-release-staging: | ||
name: "Simulate release" | ||
runs-on: ubuntu-latest | ||
needs: [ create-release ] | ||
environment: ${{ inputs.environment }} | ||
if: ${{ inputs.staging == true }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
repository: 'UnifierHQ/unifier-version' | ||
ref: ${{ inputs.branch_version }} | ||
- name: Download Unifier | ||
run: | | ||
git clone --branch ${{ inputs.branch }} https://github.com/UnifierHQ/unifier | ||
- name: Set up Git config | ||
run: | | ||
git config --global user.name "GitHub Actions" | ||
git config --global user.email "<>" | ||
- name: Set up Python 3.12 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
- name: Bump version | ||
run: | | ||
python3 ./scripts/bump.py | ||
- name: Delete Unifier | ||
run: | | ||
rm -rf ./unifier |
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
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
This file was deleted.
Oops, something went wrong.