Skip to content

Release

Release #233

Workflow file for this run

name: Release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-dev.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+"
permissions:
contents: read
env:
DAGGER_VERSION: 0.18.14
jobs:
artifacts:
name: Artifacts
uses: ./.github/workflows/artifacts.yaml
with:
publish: true
permissions:
contents: read
packages: write
id-token: write
security-events: write
dagger:
name: Dagger
runs-on: depot-ubuntu-latest-8
permissions:
contents: write
packages: write
id-token: write
security-events: write
steps:
# Required as a workaround for Dagger to properly detect Git metadata
- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
persist-credentials: false
- name: Run pipeline
uses: dagger/dagger-for-github@d913e70051faf3b907d4dd96ef1161083c88c644 # v8.2.0
with:
verb: call
args: release --version ${{ github.ref_name }} --github-actor ${{ github.actor }} --github-token env:GITHUB_TOKEN --pypi-token env:PYPI_TOKEN --npm-token env:NPM_TOKEN
cloud-token: ${{ secrets.DAGGER_CLOUD_NO_CACHE_TOKEN }}
version: ${{ env.DAGGER_VERSION }}
env:
GITHUB_TOKEN: ${{ github.token }}
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
sdk-python-release:
name: Python SDK Release
runs-on: depot-ubuntu-latest-8
steps:
- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
ref: ${{ github.head_ref }}
persist-credentials: false
- name: Get short SHA
id: get-short-sha
run: |
id=$(echo ${{ github.sha }} | cut -c 1-12)
echo "id=${id}" >> $GITHUB_OUTPUT
# If you keep using Nix for your dev shell / tooling, retain these steps
- name: Set up Nix
uses: nixbuild/nix-quick-install-action@2c9db80fb984ceb1bcaa77cdda3fdf8cfba92035 # v34
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
nix_conf: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
keep-env-derivations = true
keep-outputs = true
- name: Restore Nix store
uses: nix-community/cache-nix-action/restore@b426b118b6dc86d6952988d396aa7c6b09776d08 # v7.0.0
with:
primary-key: ${{ runner.os }}-openmeter-nix-build-${{ github.ref_name }}-${{ hashFiles('flake.*') }}
restore-prefixes-first-match: |
${{ runner.os }}-openmeter-nix-build-${{ github.ref_name }}-
${{ runner.os }}-openmeter-nix-build-main-${{ hashFiles('flake.*') }}
${{ runner.os }}-openmeter-nix-build-main-
${{ runner.os }}-openmeter-nix-build-
- name: Publish Python package via Nix make target
run: |
nix develop --impure .#ci -c make -C api/client/python publish-python-sdk
env:
PY_SDK_RELEASE_VERSION: ${{ github.ref_name }}
COMMIT_SHORT_SHA: ${{ steps.get-short-sha.outputs.id }}
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}