Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
rpsene authored May 14, 2024
0 parents commit fe67d84
Show file tree
Hide file tree
Showing 5 changed files with 509 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build Charter

on:
push:
branches:
- main
pull_request:
types: [opened, reopened, edited]
branches:
- main
workflow_dispatch:
inputs:
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

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Build Container Image
run: docker build -t riscv-charter ./

- name: Build Newsletter
run: docker run --rm -v ${PWD}:/build -w /build riscv-charter:latest

- name: Upload PDF
uses: actions/upload-artifact@v3
with:
name: Charter PDF
path: ${{ github.workspace }}/*.pdf

# Create Release
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: ${{ github.workspace }}/*.pdf
tag_name: charter-${{ github.run_number }}
name: Charter ${{ github.run_number }}
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.
12 changes: 12 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Use the riscvintl/riscv-docs-base-container-image as a base image
FROM riscvintl/riscv-docs-base-container-image:latest

# Metadata as a label
LABEL maintainer="Rafael Sene rafael@riscv.org"

# Set the working directory in the container to /build
WORKDIR /build

# Run asciidoctor-pdf when the container launches
CMD sh -c "asciidoctor-pdf -o charter-$(date +%Y%m%d).pdf \
-a compress ./charter.adoc"
Loading

0 comments on commit fe67d84

Please sign in to comment.