-
Notifications
You must be signed in to change notification settings - Fork 71
Expand file tree
/
Copy pathtidy3d-python-client-update-lockfile.yml
More file actions
100 lines (87 loc) · 3.67 KB
/
tidy3d-python-client-update-lockfile.yml
File metadata and controls
100 lines (87 loc) · 3.67 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: public/tidy3d/python-client-update-lockfile
on:
workflow_dispatch:
inputs:
run-workflow:
description: 'Set to true to update the lock file and create a PR'
required: true
type: boolean
default: true
source_branch:
description: 'Source branch to checkout and update lockfile for'
required: false
type: string
default: 'develop'
workflow_call:
inputs:
run-workflow:
description: 'Set to true to update the lock file and create a PR'
required: true
type: boolean
default: true
source_branch:
description: 'Source branch to checkout and update lockfile for'
required: false
type: string
default: 'develop'
permissions:
contents: read
jobs:
update-lockfile:
if: github.event.inputs.run-workflow || inputs.run-workflow
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: ${{ github.event.inputs.source_branch || inputs.source_branch || 'develop' }}
fetch-depth: 1
submodules: false
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.10'
- name: Install Poetry
uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a # v1.4.1
with:
version: 2.1.1
virtualenvs-create: true
virtualenvs-in-project: true
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@8df5847569e6427dd6c4fb1cf565c83acfa8afa7 # v6.0.0
with:
aws-access-key-id: ${{ secrets.AWS_CODEARTIFACT_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_CODEARTIFACT_ACCESS_SECRET }}
aws-region: us-east-1
- name: Configure CodeArtifact authentication
run: |
set -e
echo "Getting CodeArtifact token..."
CODEARTIFACT_AUTH_TOKEN=$(aws codeartifact get-authorization-token \
--domain flexcompute \
--domain-owner 625554095313 \
--query authorizationToken \
--output text)
echo "Configuring Poetry with CodeArtifact credentials..."
poetry config http-basic.codeartifact aws $CODEARTIFACT_AUTH_TOKEN
- name: Update lock file
run: |
set -e
poetry update --lock
- name: Create Pull Request
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "chore(deps): :robot: Update `poetry.lock` for ${{ github.event.inputs.source_branch || inputs.source_branch || 'develop' }}"
title: "chore(deps): :robot: Update `poetry.lock` for ${{ github.event.inputs.source_branch || inputs.source_branch || 'develop' }}"
body: |
This pull request was automatically generated by a GitHub Action.
It updates the `poetry.lock` file to reflect changes in the pip state, and whether the package is broken by external dependency changes.
Source branch: ${{ github.event.inputs.source_branch || inputs.source_branch || 'develop' }}
branch: "chore/update-poetry-lock-${{ github.event.inputs.source_branch || inputs.source_branch || 'develop' }}"
base: "${{ github.event.inputs.source_branch || inputs.source_branch || 'develop' }}"
delete-branch: true