-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (50 loc) · 1.73 KB
/
Copy pathupdate-examples.yml
File metadata and controls
51 lines (50 loc) · 1.73 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
name: Update examples
on:
pull_request:
types: [closed]
paths:
- examples/**
jobs:
update_examples:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
path: workspace
fetch-depth: 0
- name: Install Rush
run: npm install @microsoft/rush --location=global
- name: Install dependencies
working-directory: workspace
run: rush install
- name: Pack all examples
working-directory: workspace
run: |
for dir in examples/*/; do
rush-pnpm pack -C $dir
done
- name: Extract all packed examples in-place
working-directory: workspace
# Extract the `pnpm pack` generated tarballs (which have workspace:* links replaced with npm-resolvable versions)
# in-place, which overwrites the old package.json and "transforms" the example into a portable project that can
# be referenced outside of rush/pnpm.
run: |
find . -name '*.tgz' -exec sh -c 'tar xzvf {} -C $(dirname {}) --strip-components=1 && rm {}' \;
- name: Checkout example repo
uses: actions/checkout@v3
with:
repository: contentauth/c2pa-js-examples
ref: main
path: examples
token: ${{ secrets.ORG_PUBLIC_REPO_ACCESS }}
- name: Merge modified examples into example directory
run: |
rsync -a workspace/examples/ examples/
- name: Commit examples
working-directory: examples
run: |
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "Updated to ${{ github.repository }}@${{ github.sha }}"
git push