-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Workflow to generate and push language reference documentation #14852
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
pikinier20
merged 2 commits into
scala:main
from
dotty-staging:scaladoc/language-reference-workflow
Apr 12, 2022
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
name: language-reference-documentation | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'language-reference-stable' | ||
pull_request: | ||
branches: | ||
- 'language-reference-stable' | ||
workflow_dispatch | ||
|
||
jobs: | ||
build-and-push: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Get current date | ||
id: date | ||
run: echo "::set-output name=date::$(date +'%Y-%m-%d')" | ||
|
||
- name: Git Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
path: 'dotty' | ||
ref: 'language-reference-stable' | ||
ssh-key: ${{ secrets.DOCS_KEY }} | ||
|
||
- name: Cache Coursier | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.cache/coursier | ||
key: sbt-coursier-cache | ||
|
||
- name: Cache SBT | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.sbt | ||
key: sbt-${{ hashFiles('**/build.sbt') }} | ||
|
||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Latest release is currently 3.x, should we use a more recent one? |
||
with: | ||
java-version: 11 | ||
|
||
- name: Generate reference documentation and test links | ||
run: | | ||
./dotty/project/scripts/sbt scaladoc/generateReferenceDocumentation --no-regenerate-expected-links | ||
./dotty/project/scripts/docsLinksStability ./dotty/scaladoc/output/reference ./dotty/project/scripts/expected-links/reference-expected-links.txt | ||
|
||
- name: Push changes to scala3-reference-docs | ||
if: github.event_name == 'push' | ||
uses: actions/checkout@v3 | ||
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 [email protected] | ||
git add . | ||
git commit -m "UPDATE ${{ steps.date.outputs.date }}" | ||
git push | ||
cd .. | ||
|
||
- name: Merge changes to main | ||
if: github.event_name == 'push' | ||
run: | | ||
cd dotty | ||
git fetch origin main:main | ||
git checkout main | ||
git merge language-reference-stable | ||
cd .. | ||
|
||
- name: Create pull reuqest with backport to main | ||
if: github.event_name == 'push' | ||
uses: peter-evans/create-pull-request@v4 | ||
with: | ||
path: dotty | ||
branch: language-reference-backport | ||
labels: area:documentation | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think these could and should be replaced with https://github.com/coursier/cache-action?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is copy-paste from our CI. Perhaps we can make it better