Skip to content

Commit

Permalink
add workflow create-release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
entorb committed Dec 24, 2022
1 parent 4462e64 commit 6b4f274
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 12 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/check-pr.yml
@@ -1,7 +1,7 @@
# This workflow performs chapter quality (known issues) and code quality checks upon new Commits and PRs
# configured in .pre-commit-config.yaml and setup.cfg
# This workflow performs chapter quality (known issues) and code quality checks upon new commits and PRs.
# Configured in .pre-commit-config.yaml and setup.cfg

name: Check new Commits and PRs
name: Check new commits and PRs

on:
workflow_dispatch:
Expand Down
69 changes: 69 additions & 0 deletions .github/workflows/create-release.yml
@@ -0,0 +1,69 @@
# This manually started workflow builds PDFs and eBooks and creates a new release with these assets.
# Build part is copied from make.yml .

name: "Create Release"

on:
workflow_dispatch:
inputs:
version_number:
description: 'Version number'
required: true
default: 'v1.2.1'
version_text:
description: 'Description'
required: false
default: ''

jobs:
release:
runs-on: ubuntu-22.04

steps:
# - name: test print
# run: |
# echo "version_number: ${{ github.event.inputs.version_number }}"
# echo "version_number: ${{ github.event.inputs.version_text }}"

# steps are copied from make.yml

- name: checkout repository
uses: actions/checkout@v3

- name: Python setup
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: set up Python cache
uses: actions/cache@v3
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-py-cache

- name: quality check of chapters for known issues
run: python3 scripts/check-chapters.py

- name: run pre-commit tests
# configured in .pre-commit-config.yaml and setup.cfg
uses: pre-commit/action@v3.0.0

- name: install requirements
run: sh scripts/install_requirements.sh > /dev/null

- name: make PDFs
run: sh scripts/make_pdfs.sh > /dev/null

- name: make eBooks
run: sh scripts/make_ebooks.sh

- name: "create release"
uses: softprops/action-gh-release@v1
with:
tag_name: "${{ inputs.version_number }}"
prerelease: false
files: |
./hpmor*.pdf
./hpmor.epub
./hpmor.mobi
./hpmor.fb2
19 changes: 10 additions & 9 deletions .github/workflows/make.yml
@@ -1,4 +1,5 @@
# This workflow builds PDF and ebook upon new Commits
# This workflow builds PDFs and eBooks upon push of new commits.
# Generated assets are uploaded to release WorkInProgress.

name: Build HPMOR PDFs and eBooks

Expand All @@ -8,7 +9,7 @@ on:
branches: [ main ]

jobs:
job1:
build:
runs-on: ubuntu-22.04
# runs-on: ubuntu-latest
steps:
Expand All @@ -19,21 +20,21 @@ jobs:
- name: checkout repository
uses: actions/checkout@v3

- name: python setup
- name: Python setup
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Set up Python cache
- name: set up Python cache
uses: actions/cache@v3
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-py-cache

- name: test ls before
run: |
pwd
ls -al
# - name: test ls before
# run: |
# pwd
# ls -al

- name: quality check of chapters for known issues
run: python3 scripts/check-chapters.py
Expand Down Expand Up @@ -64,7 +65,7 @@ jobs:
pwd
ls -al
- name: upload to release
- name: upload files to release WorkInProgress
uses: softprops/action-gh-release@v1
with:
tag_name: WorkInProgress
Expand Down

0 comments on commit 6b4f274

Please sign in to comment.