Skip to content

Commit

Permalink
More consolidation
Browse files Browse the repository at this point in the history
  • Loading branch information
pgm committed Jan 9, 2025
1 parent e533e1b commit 16016fe
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 81 deletions.
27 changes: 0 additions & 27 deletions .github/actions/generate-breadbox-client/action.yml

This file was deleted.

24 changes: 24 additions & 0 deletions .github/actions/publish-breadbox-client/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: "publish-breadbox-client"
description: "Publishes breadbox client to google artifact service"
runs:
using: "composite"
steps:
- name: "Authenticate to Google Cloud"
uses: google-github-actions/auth@v2
with:
# See instructions here: https://github.com/google-github-actions/auth?tab=readme-ov-file#service-account-key-json
credentials_json: ${{ secrets.DEPMAP_ARTIFACTS_SVC_ACCT }}

- name: "Set up authentication for publishing breadbox client"
working-directory: "./breadbox-client"
run: |
find ./breadbox_client
poetry self add keyrings.google-artifactregistry-auth
poetry config repositories.public-python https://us-central1-python.pkg.dev/cds-artifacts/public-python/
shell: bash

- name: "Publish new breadbox client version to Artifact Registry"
working-directory: "./breadbox-client"
run: |
poetry publish --build --repository public-python
shell: bash
43 changes: 7 additions & 36 deletions .github/workflows/build_breadbox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,43 +192,14 @@ jobs:
if: ${{ (needs.bump-versions.outputs.current_version != needs.bump-versions.outputs.bumped_version) && (github.ref_name == 'master') }}
runs-on: ubuntu-latest
steps:
- name: Check out
- name: "Check out"
uses: actions/checkout@v3
with:
token: "${{ secrets.GITHUB_TOKEN }}"
fetch-depth: 0
- run: |
git pull origin HEAD:master
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
# See instructions here: https://github.com/google-github-actions/auth?tab=readme-ov-file#service-account-key-json
credentials_json: ${{ secrets.DEPMAP_ARTIFACTS_SVC_ACCT }}
- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
version: 1.7.1
virtualenvs-create: true
virtualenvs-in-project: true
- name: Set up cache
uses: actions/cache@v2
id: cached-poetry-dependencies
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
- name: Generate breadbox client
uses: ./.github/actions/generate-breadbox-client # defined as a re-usable action
# the above does a checkout which deletes the credential file, so we need to execute authenticate to google cloud after it
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v2
with:
# See instructions here: https://github.com/google-github-actions/auth?tab=readme-ov-file#service-account-key-json
credentials_json: ${{ secrets.DEPMAP_ARTIFACTS_SVC_ACCT }}
- name: Set up for publishing breadbox client
working-directory: ./breadbox-client
run: |
poetry self add keyrings.google-artifactregistry-auth
poetry config repositories.public-python https://us-central1-python.pkg.dev/cds-artifacts/public-python/
- name: Publish new breadbox client version to Artifact Registry
working-directory: ./breadbox-client
run: poetry publish --build --repository public-python

- name: Prepare breadbox client
uses: ./.github/actions/prepare-breadbox-client # checks out and generates breadbox client code

- name: Publish breadbox client
uses: ./.github/actions/publish-breadbox-client
19 changes: 2 additions & 17 deletions .github/workflows/publish_breadbox_client.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,5 @@ jobs:
- name: Prepare breadbox client
uses: ./.github/actions/prepare-breadbox-client # checks out and generates breadbox client code

- name: "Authenticate to Google Cloud"
uses: google-github-actions/auth@v2
with:
# See instructions here: https://github.com/google-github-actions/auth?tab=readme-ov-file#service-account-key-json
credentials_json: ${{ secrets.DEPMAP_ARTIFACTS_SVC_ACCT }}

- name: "Set up authentication for publishing breadbox client"
working-directory: "./breadbox-client"
run: |
find ./breadbox_client
poetry self add keyrings.google-artifactregistry-auth
poetry config repositories.public-python https://us-central1-python.pkg.dev/cds-artifacts/public-python/
- name: "Publish new breadbox client version to Artifact Registry"
working-directory: "./breadbox-client"
run: |
poetry publish --build --repository public-python
- name: Publish breadbox client
uses: ./.github/actions/publish-breadbox-client
2 changes: 1 addition & 1 deletion breadbox-client/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "breadbox-client"
version = "3.20.0+pgmdev"
version = "3.20.0+pgmdev2"
description = "A client library for accessing Breadbox"

authors = []
Expand Down

0 comments on commit 16016fe

Please sign in to comment.