You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# This workflow will create a github release and upload a Python Package to pypi
2
-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3
-
name: Release
4
-
# Release a new version to different targets in suitable ways
1
+
name: Build and Deploy to GitHub Container Registry
5
2
6
3
on:
7
-
workflow_call: # called from ci.yml
8
-
inputs:
9
-
to_github:
10
-
description: "Create a Github Release (repository snapshot)"
11
-
type: boolean
12
-
default: true
13
-
14
-
to_test_pypi:
15
-
description: "Publish to Test PyPI."
16
-
type: boolean
17
-
default: false
18
-
19
-
to_pypi:
20
-
description: "Publish to PyPI."
21
-
type: boolean
22
-
default: false
4
+
release:
5
+
types: [ published ]
6
+
push:
7
+
tags:
8
+
- '*'
9
+
workflow_dispatch:
23
10
11
+
env:
12
+
REGISTRY: ghcr.io
13
+
IMAGE_NAME: ${{ github.repository }}
24
14
25
15
jobs:
26
-
27
-
github:
28
-
if: inputs.to_github
29
-
name: Create a Github Release (repository snapshot)
16
+
build-and-push:
30
17
runs-on: ubuntu-latest
31
18
permissions:
32
-
contents: write # needed for creating a GH Release
33
-
steps:
34
-
- uses: actions/checkout@v3
35
-
- uses: softprops/action-gh-release@v1
19
+
contents: read
20
+
packages: write
36
21
37
-
pypi:
38
-
if: inputs.to_pypi || inputs.to_test_pypi
39
-
name: Publish to PyPI (and/or compatible repositories)
40
-
runs-on: ubuntu-latest
41
-
permissions:
42
-
id-token: write # needed for "trusted publishing" protocol
0 commit comments