Skip to content
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

API docs #1697

Merged
merged 12 commits into from
Oct 8, 2024
31 changes: 31 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@ permissions:
on:
release:
types: [published]
# To manually trigger a rebuild of the API docs if needed
workflow_dispatch:

jobs:
publish:
name: Langium Publish
runs-on: ubuntu-latest
timeout-minutes: 20
if: ${{ github.event_name == 'release' }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if we want to constrain the publish job like this. We didn't need it before, and I think we may want to run this under different circumstances than this constraint would allow.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because we didn't have any other trigger before, but now I added the workflow_dispatch trigger to allow updating the docs manually even before a release. Now that I think about it, I'm not sure if this would actually ever be used

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, yeah I'm still not sure about this one. @msujew thoughts here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes more sense to have a separate workflow_dispatch job for the API docs publishing - right now, the release publishing process is broken due to expired credentials.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By "separate job", do you mean an entirely separate .yml file or just the additional trigger here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A separate yml file :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -56,3 +59,31 @@ jobs:
PACKAGE_VERSION=`npm pkg get version --workspaces=false | tr -d \"`
vsce package
ovsx publish langium-vscode-$PACKAGE_VERSION.vsix -p ${{ secrets.OVSX_TOKEN }}

docs:
name: Build and publish API docs
runs-on: ubuntu-latest
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
- name: Build API docs
run: |
npm ci
npm run docs -w langium
- name: Upload docs artifact
uses: actions/upload-pages-artifact@v3
with:
path: packages/langium/docs
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
.vscode-test/
coverage/
dist/
docs/
lib/
out/
node_modules/
Expand Down
Loading
Loading