-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CI/CD scripts from docs-template repo
Signed-off-by: Christoph Müllner <[email protected]>
- Loading branch information
Showing
3 changed files
with
109 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,8 @@ | ||
--- | ||
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#package-ecosystem | ||
version: 2 | ||
updates: | ||
- package-ecosystem: gitsubmodule | ||
directory: / | ||
schedule: | ||
interval: daily |
This file contains 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: Create Specification Document | ||
|
||
# The workflow is triggered by pull request, push to main, and manual dispatch. | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
revision_mark: | ||
description: 'Set revision mark as Draft, Release or Stable:' | ||
required: true | ||
type: choice | ||
options: | ||
- Development | ||
- Stable | ||
- Frozen | ||
- Ratified | ||
default: Development | ||
prerelease: | ||
description: Tag as a pre-release? | ||
required: false | ||
type: boolean | ||
default: true | ||
draft: | ||
description: Create release as a draft? | ||
required: false | ||
type: boolean | ||
default: false | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Checkout the repository | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Get next version | ||
uses: reecetech/[email protected] | ||
id: version | ||
with: | ||
scheme: semver | ||
increment: patch | ||
|
||
# Pull the latest RISC-V Docs container image | ||
- name: Pull Container | ||
run: docker pull riscvintl/riscv-docs-base-container-image:latest | ||
|
||
# Override VERSION and REVMARK for manual workflow dispatch | ||
- name: Update environment variables | ||
run: | | ||
echo "VERSION=v${{ steps.version.outputs.version }}" >> "$GITHUB_ENV" | ||
echo "REVMARK=${{ github.event.inputs.revision_mark }}" >> "$GITHUB_ENV" | ||
if: github.event_name == 'workflow_dispatch' | ||
|
||
# Build Files | ||
- name: Build Files | ||
run: make | ||
|
||
# Upload the built PDF files as a single artifact | ||
- name: Upload Build Artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: Build Artifacts | ||
path: ${{ github.workspace }}/build/*.pdf | ||
retention-days: 30 | ||
|
||
# Create Release | ||
- name: Create Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: ${{ github.workspace }}/build/*.pdf | ||
tag_name: v${{ steps.version.outputs.version }} | ||
name: Release ${{ steps.version.outputs.version }} | ||
draft: ${{ github.event.inputs.draft }} | ||
prerelease: ${{ github.event.inputs.prerelease }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GHTOKEN }} | ||
if: github.event_name == 'workflow_dispatch' | ||
# This condition ensures this step only runs for workflow_dispatch events. |
This file contains 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,15 @@ | ||
--- | ||
name: pre-commit | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
- uses: pre-commit/[email protected] |