Skip to content

Support chained assignments #98

Support chained assignments

Support chained assignments #98

Workflow file for this run

---
name: publish
on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+
- v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+
concurrency:
group: publish-${{ github.ref }}
cancel-in-progress: false
env:
GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError"'
GRADLE_SWITCHES: --console=plain --info --stacktrace --warning-mode=all --no-daemon
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.gradle_enterprise_access_key }}
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.ossrh_username }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.ossrh_token }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ossrh_signing_key }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ossrh_signing_password }}
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
show-progress: false
- name: set-up-jdk
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
- name: set-up-gradle
uses: gradle/actions/setup-gradle@v4
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install Poetry
uses: snok/install-poetry@v1
- name: publish-candidate
if: contains(github.ref, '-rc.')
run: |
./gradlew \
${{ env.GRADLE_SWITCHES }} \
-Preleasing \
-Prelease.disableGitChecks=true \
-Prelease.useLastTag=true \
candidate \
publish \
closeAndReleaseSonatypeStagingRepository
- name: publish-release
if: (!contains(github.ref, '-rc.'))
run: |
./gradlew \
${{ env.GRADLE_SWITCHES }} \
-Preleasing \
-Prelease.disableGitChecks=true \
-Prelease.useLastTag=true \
final \
publish \
closeAndReleaseSonatypeStagingRepository
- name: Extract version from ref
id: extract_version
run: |
ref=${GITHUB_REF##*/}
echo "Extracted ref: $ref"
version=${ref#v}
echo "Extracted version: $version"
echo "::set-output name=VERSION::$version"
- name: Set project version with Poetry
working-directory: rewrite
run: poetry version ${{ steps.extract_version.outputs.VERSION }}
- name: publish-python
working-directory: rewrite
if: (!contains(github.ref, '-rc.'))
run: |
poetry install --no-interaction --no-ansi
poetry build
poetry publish --username __token__ --password ${{ secrets.PYPI_TOKEN }}
git restore --staged --worktree . && git clean -fd