Skip to content

make setuptools an install requirement since pkg_resources is used #9

make setuptools an install requirement since pkg_resources is used

make setuptools an install requirement since pkg_resources is used #9

Workflow file for this run

on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
name: Upload Released Almanac
jobs:
build:
name: Upload Released Almanac
runs-on: ubuntu-latest
steps:
- id: get_version
uses: battila7/get-version-action@v2
- uses: actions/checkout@v3
- name: Set up Python to run almanac generation script
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Install base dependencies
run: |
python -m pip install --upgrade pip
python -m pip install wheel
sudo apt update -q -y
sudo apt install -q -y enscript ghostscript
- name: Install almanac package
run: |
pip install -e .[all]
- name: Run yearly_almanac and convert to PDF
run: |
yearly_almanac -o almanac.txt -y ${{ steps.get_version.outputs.major }}
enscript -B -r -f Courier9 -p almanac.ps almanac.txt
gs -q -dSAFER -sBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=almanac_${{ steps.get_version.outputs.major }}.pdf \
-dAutoRotatePages=/None -c "<</Orientation 3>> setpagedevice" -f almanac.ps
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ steps.get_version.outputs.major }}, v${{ steps.get_version.outputs.minor }}.${{ steps.get_version.outputs.patch }}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./almanac_${{ steps.get_version.outputs.major }}.pdf
asset_name: almanac_${{ steps.get_version.outputs.major }}.pdf
asset_content_type: application/pdf