-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (54 loc) · 2.26 KB
/
mirror-artifacts.yml
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
on:
workflow_dispatch:
inputs:
version:
description: 'Version to release'
required: true
env:
SOURCE_REPO: core-platform
ARGUS_ARTIFACTS_REPO: argus-artifacts
name: mirror
jobs:
mirror-artifacts:
runs-on: [ARM64, self-hosted, Linux]
steps:
# See https://docs.github.com/en/actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow
# For why we need to generate a token and not use the default
- name: Generate token
id: generate_token
uses: chanzuckerberg/[email protected]
with:
app_id: ${{ secrets.CZI_RELEASE_PLEASE_APP_ID }}
private_key: ${{ secrets.CZI_RELEASE_PLEASE_PK }}
- # checkout the artifact repo
uses: actions/checkout@v4
with:
token: ${{ steps.generate_token.outputs.token }}
path: ${{ github.event.repository.name }}
- # checkout the source repo
uses: actions/checkout@v4
with:
token: ${{ steps.generate_token.outputs.token }}
repository: chanzuckerberg/${{ env.SOURCE_REPO}}
path: ${{ env.SOURCE_REPO}}
- # copy ci files to argus-artifacts
run: |
cp -r --parents ci/packages/*/dist/ ../${{ env.ARGUS_ARTIFACTS_REPO }}/
cp -r --parents ci/packages/*/action.y*ml ../${{ env.ARGUS_ARTIFACTS_REPO }}/
working-directory: ${{ env.SOURCE_REPO }}
- run: ls -la ./${{ env.ARGUS_ARTIFACTS_REPO }}
- run: ls ./${{ env.ARGUS_ARTIFACTS_REPO }}/ci/packages/create-stack/
- run: ls ./${{ env.ARGUS_ARTIFACTS_REPO }}/ci/packages/create-stack/dist/
- run: ls ./${{ env.ARGUS_ARTIFACTS_REPO }}/ci/packages/delete-stack/
- run: ls ./${{ env.ARGUS_ARTIFACTS_REPO }}/ci/packages/delete-stack/dist/
- run: ls ./${{ env.ARGUS_ARTIFACTS_REPO }}/ci/packages/shared/
- run: ls ./${{ env.ARGUS_ARTIFACTS_REPO }}/ci/packages/shared/dist/
- # make commit to argus artifacts
uses: EndBug/add-and-commit@v9
id: argus_artifacts_commit
with:
add: -A
message: ci - mirror argus artifacts
cwd: ${{ env.ARGUS_ARTIFACTS_REPO }}
tag: '${{ inputs.version }} --force'
github_token: ${{ steps.generate_token.outputs.token }}