forked from dstackai/dstack
-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (53 loc) · 1.91 KB
/
Copy pathupload-post-pypi-artifacts.yml
File metadata and controls
55 lines (53 loc) · 1.91 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
name: Upload Post-PyPI Artifacts
on:
workflow_call:
inputs:
version:
type: string
required: true
is-latest-version:
type: boolean
required: true
staging:
type: boolean
required: true
jobs:
upload-post-pypi-artifacts:
runs-on: ubuntu-latest
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
steps:
- uses: astral-sh/setup-uv@v5
with:
python-version: 3.11
# settings to prevent warnings when running uv without a repo checkout
enable-cache: false
ignore-empty-workdir: true
- name: Install AWS
run: uv tool install awscli
- name: Download JSON schemas
uses: actions/download-artifact@v4
with:
name: json-schemas
path: json-schemas
- name: Upload JSON schemas to S3
working-directory: json-schemas
run: |
BUCKET=dstack-runner-downloads
if [ "${{ inputs.staging }}" = "true" ]; then
BUCKET=dstack-runner-downloads-stgn
fi
aws s3 cp configuration.json "s3://$BUCKET/${{ inputs.version }}/schemas/configuration.json" --acl public-read
aws s3 cp profiles.json "s3://$BUCKET/${{ inputs.version }}/schemas/profiles.json" --acl public-read
if [ "${{ inputs.is-latest-version }}" = "true" ]; then
aws s3 cp configuration.json "s3://$BUCKET/latest/schemas/configuration.json" --acl public-read
aws s3 cp profiles.json "s3://$BUCKET/latest/schemas/profiles.json" --acl public-read
fi
- name: Set latest version in S3
run: |
CHANNEL=cli
if [ "${{ inputs.staging }}" = "true" ]; then
CHANNEL=stgn-cli
fi
echo ${{ inputs.version }} | aws s3 cp - s3://get-dstack/$CHANNEL/latest-version --acl public-read