Repository navigation
59 lines (50 loc) · 2 KB
/
Copy pathrelease-sdk-python-dev.yaml
File metadata and controls
59 lines (50 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Python SDK Beta Release
permissions:
contents: read
on:
workflow_dispatch:
push:
branches:
- main
jobs:
release-beta-sdk:
name: Python SDK Beta Release
runs-on: depot-ubuntu-latest-8
environment: dev
steps:
- uses: step-security/harden-runner@dc2769abcc0fcfbadfc1df54081c1608579ef6b2 # v2.22.2
with:
egress-policy: audit
use-policy-store: ${{ secrets.STEP_SECURITY_API_KEY != '' }}
api-key: ${{ secrets.STEP_SECURITY_API_KEY }}
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Get short SHA
id: get-short-sha
run: |
echo "id=${GITHUB_SHA:0:12}" >> "$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@9f63be77f412a248c9d9a65a4c82cf066cdf8f0c # v35
with:
# Authenticate public flake fetches to avoid GitHub API rate limits.
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@7df957e333c1e5da7721f60227dbba6d06080569 # v7.0.2
with:
primary-key: ${{ runner.os }}-openmeter-nix-build-v5-main-${{ hashFiles('.github/workflows/nix.yaml', 'flake.lock', '**/*.nix') }}
restore-prefixes-first-match: |
${{ runner.os }}-openmeter-nix-build-v5-main-
- 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_TAG: alpha
COMMIT_SHORT_SHA: ${{ steps.get-short-sha.outputs.id }}
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}