Skip to content

feat: update translation to match latest EI codebase (#307) #110

feat: update translation to match latest EI codebase (#307)

feat: update translation to match latest EI codebase (#307) #110

Workflow file for this run

name: Release
# Release flow driven directly by release-please outputs:
# - release-please decides which package paths were released (`paths_released`)
# - we only build and publish those released packages
on:
push:
branches: [main]
workflow_dispatch:
inputs:
release_target:
description: "Package to publish"
required: true
type: choice
options:
- r2x
- packages/r2x-plexos-to-sienna
- packages/r2x-reeds-to-plexos
- packages/r2x-reeds-to-sienna
- packages/r2x-sienna-to-plexos
concurrency:
group: release
cancel-in-progress: false
permissions:
contents: read
env:
UV_VERSION: "0.11.6"
jobs:
release-please:
name: Create release PR
if: github.event_name == 'push'
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: write # Required: create releases and PRs
pull-requests: write # Required: create PRs
outputs:
releases_created: ${{ steps.rp.outputs.releases_created }}
paths_released: ${{ steps.rp.outputs.paths_released }}
steps:
- name: Run release-please
id: rp
uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
config-file: .release-please-config.json
manifest-file: .release-please-manifest.json
target-branch: main
build:
name: Build release packages
needs: [release-please]
if: |
always() && (
(github.event_name == 'push' && needs.release-please.outputs.releases_created == 'true') ||
github.event_name == 'workflow_dispatch'
)
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
# Only need read permissions to checkout and build
contents: read
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
persist-credentials: false
- name: Setup uv environment
uses: ./.github/actions/setup-uv-env
with:
uv-version: ${{ env.UV_VERSION }}
python-version-file: "pyproject.toml"
sync-dependencies: "false"
- name: Resolve release targets
id: targets
shell: bash
env:
EVENT_NAME: ${{ github.event_name }}
AUTO_PATHS_RELEASED: ${{ needs.release-please.outputs.paths_released }}
MANUAL_RELEASE_TARGET: ${{ inputs.release_target }}
run: |
set -euo pipefail
if [[ "$EVENT_NAME" == "workflow_dispatch" ]]; then
paths="$(jq -cn --arg target "$MANUAL_RELEASE_TARGET" '[$target]')"
else
paths="$AUTO_PATHS_RELEASED"
fi
echo "paths_released=$(echo "$paths" | jq -c '.')" >> "$GITHUB_OUTPUT"
- name: Build released packages
shell: bash
env:
PATHS_RELEASED: ${{ steps.targets.outputs.paths_released }}
run: |
set -euo pipefail
packages=""
for path in $(echo "$PATHS_RELEASED" | jq -r '.[]'); do
[[ "$path" == "." || "$path" == "r2x" ]] && pkg="r2x" || pkg=$(basename "$path")
packages="${packages:+$packages }$pkg"
done
[[ -z "$packages" ]] && { echo "::error::No released packages to build"; exit 1; }
for pkg in $packages; do
echo "::group::Building $pkg"
uv build --package "$pkg" --out-dir dist --sdist --wheel
echo "::endgroup::"
done
ls -lah dist/
- name: Upload distributions
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: pypi-dists
path: dist/
publish:
name: Publish to PyPI
needs: [release-please, build]
if: |
always() && needs.build.result == 'success' && (
(github.event_name == 'push' && needs.release-please.outputs.releases_created == 'true') ||
github.event_name == 'workflow_dispatch'
)
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: read # Required: checkout and build
id-token: write # Required: trusted publishing to PyPI
environment:
name: pypi
steps:
- name: Download distributions
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: pypi-dists
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0
with:
packages-dir: dist/
verbose: true
skip-existing: true