-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (64 loc) · 2.33 KB
/
follow-up.yaml
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
name: Follow Up
on:
workflow_dispatch:
inputs:
run-id:
description: docs page GHA run id
required: true
type: string
jobs:
follow-up:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: github-pages
path: unofficial-documentation
repository: solvedac/unofficial-documentation
github-token: ${{ secrets.PAT_FOLLOW_UP }}
run-id: ${{ github.event.inputs.run-id }}
- run: tar -xf artifact.tar ./tsp-output/@typespec/openapi3/openapi.yaml
working-directory: unofficial-documentation
- run: ls -R
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
- uses: actions/setup-node@v4
- name: Install Dependencies
run: npm install
- name: Tricky x-internal
run: |
file=unofficial-documentation/tsp-output/@typespec/openapi3/openapi.yaml
sed -ri "s/x-internal: true/x-internal: false/" $file
- name: Generate
run: |
rm -rf src dist
npx @openapitools/openapi-generator-cli batch --clean typescript-fetch.yaml typescript-fetch-cjs.yaml
- name: Tricky CJS
run: |
for file in $(find src/cjs -type f -name *.ts); do
mv $file "$(dirname $file)/$(basename $file .ts).cts"
done
- name: Build
run: npm run build
- name: Update Version
run: |
file=unofficial-documentation/tsp-output/@typespec/openapi3/openapi.yaml
version=$(sed -rn 's/\s+version:\s*([^\n]+)/\1/p' $file | sed -rn 's/\.0+([0-9]+)/.\1/p')
sed -ri "s/\"version\": \"[^\"]+\"/\"version\": \"$version\"/" package.json
- name: Make Deno Friendly
run: |
for file in `find src -type f -name "index.ts"`; do
cp $file `echo $file | sed s/index/mod/`
done
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
commit-message: Follow-up solvedac/unofficial-documentation
title: Follow-up solvedac/unofficial-documentation
body: |
This Pull Request will update the sources based on upstream docs.
It is automatically created by GitHub Actions.
labels: follow-up