forked from scala/scala3
-
Notifications
You must be signed in to change notification settings - Fork 17
90 lines (79 loc) · 2.82 KB
/
language-reference.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Language reference documentation
on:
push:
branches:
- 'language-reference-stable'
pull_request:
branches:
- 'language-reference-stable'
workflow_dispatch:
permissions:
contents: read
jobs:
build-and-push:
name: Build reference documentation and push it
permissions:
contents: write # for Git to git push
runs-on: ubuntu-latest
steps:
- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: Git Checkout
uses: actions/checkout@v4
with:
path: 'dotty'
fetch-depth: 0
ssh-key: ${{ secrets.DOCS_KEY }}
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
cache: 'sbt'
- name: Generate reference documentation and test links
run: |
cd dotty
./project/scripts/sbt "scaladoc/generateReferenceDocumentation --no-regenerate-expected-links"
./project/scripts/docsLinksStability ./scaladoc/output/reference ./project/scripts/expected-links/reference-expected-links.txt
cd ..
env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
- name: Push changes to scala3-reference-docs
if: github.event_name == 'push'
uses: actions/checkout@v4
with:
repository: lampepfl/scala3-reference-docs
fetch-depth: 0
submodules: true
ssh-key: ${{ secrets.DOCS_DEPLOY_KEY }}
path: 'scala3-reference-docs'
- if: github.event_name == 'push'
run: |
\cp -a dotty/scaladoc/output/reference/. scala3-reference-docs/
cd scala3-reference-docs
git config user.name gh-actions
git config user.email actions@github.com
git add .
if ! git diff-index --quiet HEAD; then
git commit -m "UPDATE ${{ steps.date.outputs.date }}"
git push
fi
cd ..
backport-to-main:
name: Create pull request with backport to main
permissions:
pull-requests: write # for repo-sync/pull-request to create a PR
runs-on: ubuntu-latest
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v4
- uses: repo-sync/pull-request@v2
with:
destination_branch: main
pr_label: area:documentation
pr_title: Sync with the stable documentation branch
pr_body: |
This pull request is syncing the main with changes from language-reference-stable.
It was created automatically after ${{ github.event.head_commit.id }} by @${{ github.event.head_commit.author.username }}
pr_assignee: ${{ github.event.head_commit.author.username }}