Skip to content

Commit

Permalink
Update the build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
rpsene authored Apr 27, 2023
1 parent f841ad0 commit da2d968
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 49 deletions.
45 changes: 36 additions & 9 deletions .github/workflows/build-pdf.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
name: Build Specification
name: Build Document PDF

on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
inputs:
release_type:
description: 'Release type (draft or regular)'
required: true
type: string
default: 'regular'
version:
description: 'Release version, e.g. X.Y.Z:'
required: true
type: string
target_branch:
description: 'Target branch to run the workflow on'
required: true
default: 'main'

jobs:
build:
Expand All @@ -24,11 +32,14 @@ jobs:
- name: Pull Container
run: |
docker pull riscvintl/riscv-docs-base-container-image:latest
# Build PDF file using the container
- name: Build Files
id: build_files
run: |
docker run --rm -v ${{ github.workspace }}:/build riscvintl/riscv-docs-base-container-image:latest \
/bin/sh -c 'make'
# Set the short SHA and repo name for use in artifact names
- name: Set short SHA and repo name
run: |
Expand All @@ -39,6 +50,22 @@ jobs:
- name: Upload Build Artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.REPO_NAME }}-${{ env.SHORT_SHA }}.pdf
path: ${{ github.workspace }}/*.pdf
name: ${{ env.REPO_NAME }}-${{ env.SHORT_SHA }}
path: |
${{ github.workspace }}/*.pdf
retention-days: 7

- name: Create Release
if: steps.build_files.outcome == 'success' && github.event_name == 'workflow_dispatch' && github.event.inputs.release_type != ''
uses: softprops/action-gh-release@v1
with:
draft: ${{ github.event.inputs.release_type == 'draft' }}
tag_name: v${{ github.event.inputs.version }}
name: ${{ env.CURRENT_DATE }}
body: |
This release was created by: ${{ github.event.sender.login }}
Release Notes: ${{ github.event.inputs.release_notes }}
files: |
${{ github.workspace }}/*.pdf
env:
GITHUB_TOKEN: ${{ secrets.GHTOKEN }}
40 changes: 0 additions & 40 deletions .github/workflows/create-release.yml

This file was deleted.

0 comments on commit da2d968

Please sign in to comment.