-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (54 loc) · 1.72 KB
/
publish.yaml
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
60
61
62
63
64
65
name: Publish
on:
push:
#branches:
# - main
# Pattern matched against refs/tags
tags:
- "**"
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: "Check out"
uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
export PATH=$PATH:$HOME/.poetry/bin
echo "PATH=$PATH:$HOME/.poetry/bin" >> "$GITHUB_ENV"
poetry config virtualenvs.create false
- name: Cache Poetry virtualenv
uses: actions/cache@v3
id: cache
with:
path: ~/.virtualenvs
key: poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
poetry-${{ hashFiles('**/poetry.lock') }}
- name: Set Poetry config
run: |
poetry config virtualenvs.in-project false
poetry config virtualenvs.path ~/.virtualenvs
- name: Install Dependencies
run: poetry install
if: steps.cache.outputs.cache-hit != 'true'
- id: 'auth'
name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v1'
with:
credentials_json: "${{ secrets.GOOGLE_CREDENTIALS }}"
- name: Set up Cloud SDK
uses: 'google-github-actions/setup-gcloud@v1'
- name: Config
run: |
poetry config --list
poetry self add keyrings.google-artifactregistry-auth
poetry config repositories.artifact_registry ${{ vars.PYTHON_REGISTRY_URL }}
- name: Publish Package
run: |
poetry publish --build --repository artifact_registry