Skip to content

Decimal for this is 💰 #128

Decimal for this is 💰

Decimal for this is 💰 #128

name: Release builder
on:
push:
branches:
- master
workflow_dispatch:
inputs:
force_publish:
description: Force publish
type: boolean
force_pr:
description: Force pull request
type: boolean
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
detect_release:
name: Detect release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- id: tag
uses: salsify/action-detect-and-tag-new-version@v2
with:
tag-annotation-template: |
chore(release): {VERSION}
version-command: |
cat worf/__init__.py | cut -d = -f 2 | xargs | cut -d v -f 2
outputs:
created_tag: ${{ steps.tag.outputs.tag }}
current_version: ${{ steps.tag.outputs.current-version }}
previous_version: ${{ steps.tag.outputs.previous-version }}
publish_release:
if: inputs.force_publish || needs.detect_release.outputs.created_tag
name: Publish release
runs-on: ubuntu-latest
needs: detect_release
env:
GITHUB_TOKEN: ${{ github.token }}
PROJECT_NAME: worf
PROJECT_TYPE: package
RELEASE_FAILURE_ICON: ${{ vars.RELEASE_BUILDER_FAILURE_ICON }}
RELEASE_PENDING_ICON: ${{ vars.RELEASE_BUILDER_PENDING_ICON }}
SLACK_BOT_TOKEN: ${{ secrets.SLACK_SIX_BOT_TOKEN }}
SLACK_CHANNEL: ${{ vars.SLACK_CHANNEL }}
TARGET_NAME: pypi.org
TARGET_URL: https://pypi.org/project/worf/
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- id: message
uses: gundotio/release-builder/slack-message@v1
with:
channel-id: ${{ env.SLACK_CHANNEL }}
- run: script/build
- run: script/start
- id: build
run: script/package --build
- run: script/package --dry-run
env:
TWINE_PASSWORD: ${{ secrets.PYPI_TEST_TOKEN }}
- id: release
run: script/package --release
env:
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
- if: always()
uses: gundotio/release-builder/slack-message@v1
with:
channel-id: ${{ steps.message.outputs.channel-id }}
message-id: ${{ steps.message.outputs.message-id }}
status: ${{ steps.release.conclusion }}
build_changelog:
if: always() && needs.publish_release.result != 'failure'
name: Build changelog
runs-on: ubuntu-latest
needs: publish_release
steps:
- uses: actions/checkout@v3
- id: changelog
uses: gundotio/release-builder/build-changelog@v1
outputs:
has_prs: ${{ steps.changelog.outputs.has_prs }}
previous_version: ${{ steps.changelog.outputs.previous_version }}
next_version: ${{ steps.changelog.outputs.next_version }}
notes: ${{ steps.changelog.outputs.notes }}
release: ${{ steps.changelog.outputs.release }}
create_pr:
if: always() && inputs.force_pr || needs.build_changelog.outputs.has_prs
name: Create pull request
runs-on: ubuntu-latest
needs: build_changelog
steps:
- uses: actions/checkout@v3
with:
ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
- run: pipx install poetry
- run: poetry version ${{ needs.build_changelog.outputs.next_version }}
- run: echo '__version__ = "${{ needs.build_changelog.outputs.next_version }}"' > worf/__init__.py
- uses: gundotio/release-builder/pull-request@v1
with:
next_version: ${{ needs.build_changelog.outputs.next_version }}
notes: ${{ needs.build_changelog.outputs.notes }}
previous_version: ${{ needs.build_changelog.outputs.previous_version }}
release: ${{ needs.build_changelog.outputs.release }}