mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-10 16:48:31 +02:00
Fix homebrew release, add options for relase pipeline (#1154)
This commit is contained in:
parent
2e254d55fb
commit
c06b5cf297
1 changed files with 17 additions and 2 deletions
19
.github/workflows/release.yaml
vendored
19
.github/workflows/release.yaml
vendored
|
@ -5,6 +5,18 @@ on:
|
|||
version:
|
||||
description: 'Version (e.g. v2.5, v2.5.1-beta, v2.6-beta2)'
|
||||
required: true
|
||||
include_repo_version:
|
||||
description: 'Update version in repo? (yes/no)'
|
||||
require: true
|
||||
default: yes
|
||||
include_pypi:
|
||||
description: 'Publish to PyPI? (yes/no)'
|
||||
required: true
|
||||
default: yes
|
||||
include_brew:
|
||||
description: 'Publish to Homebrew? (yes/no)'
|
||||
required: true
|
||||
default: yes
|
||||
|
||||
jobs:
|
||||
validate:
|
||||
|
@ -65,12 +77,13 @@ jobs:
|
|||
run: pip install poetry
|
||||
|
||||
- name: Update version in files
|
||||
if: {{ github.event.inputs.include_repo_version == 'yes' }}
|
||||
run: |
|
||||
poetry version "$JRNL_VERSION"
|
||||
echo __version__ = \"$JRNL_VERSION\" > jrnl/__version__.py
|
||||
|
||||
- name: Commit updated files
|
||||
if: ${{ github.repository == env.HOME_REPO }}
|
||||
if: ${{ github.event.inputs.include_repo_version == 'yes' && github.repository == env.HOME_REPO }}
|
||||
run: |
|
||||
git add pyproject.toml jrnl/__version__.py
|
||||
git commit -m "Increment version to ${JRNL_VERSION}"
|
||||
|
@ -82,7 +95,7 @@ jobs:
|
|||
run: poetry build
|
||||
|
||||
- name: Deploy to PyPI
|
||||
if: ${{ github.repository == env.HOME_REPO }}
|
||||
if: ${{ github.event.inputs.include_pypi == 'yes' && github.repository == env.HOME_REPO }}
|
||||
env:
|
||||
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
|
||||
run: poetry publish
|
||||
|
@ -94,6 +107,7 @@ jobs:
|
|||
echo "::set-output name=pypi_version::$pypi_version"
|
||||
|
||||
release_homebrew:
|
||||
if: ${{ github.event.inputs.include_brew == 'yes' }}
|
||||
needs: release_pypi
|
||||
name: "Release to Homebrew"
|
||||
runs-on: macos-latest
|
||||
|
@ -155,6 +169,7 @@ jobs:
|
|||
BRANCH_NAME="jrnl-${JRNL_VERSION}--${RANDOM}"
|
||||
git remote rename origin upstream
|
||||
git remote add origin "https://github.com/${BOT_REPO}.git"
|
||||
git fetch --unshallow upstream
|
||||
git fetch origin
|
||||
git checkout -b $BRANCH_NAME
|
||||
git push -u origin $BRANCH_NAME
|
||||
|
|
Loading…
Add table
Reference in a new issue