mirror of
https://github.com/How-To-Build-a-Commons/HowToBuildACommonsWorkbooks.git
synced 2026-04-19 16:51:04 +00:00
trying to accommodate initialization of CI by creating a Release
This commit is contained in:
parent
2ca73c3034
commit
900ea3af5a
1 changed files with 44 additions and 30 deletions
74
.github/workflows/main.yml
vendored
74
.github/workflows/main.yml
vendored
|
|
@ -5,43 +5,57 @@ on:
|
||||||
- '*'
|
- '*'
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write # Required to create releases
|
contents: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
convert_via_pandoc:
|
convert_via_pandoc:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository and submodules
|
- name: Checkout repository and submodules
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
- run: sudo add-apt-repository -y ppa:sunderme/texstudio
|
|
||||||
|
- name: Check if release exists
|
||||||
- run: sudo apt install texlive-latex-extra
|
id: check_release
|
||||||
- run: echo $PWD
|
run: |
|
||||||
- run: ls -al ./
|
if gh release view ${{ github.ref_name }} > /dev/null 2>&1; then
|
||||||
- run: ls -al ../
|
echo "exists=true" >> $GITHUB_OUTPUT
|
||||||
- run: sed -i 's/VERSIONNUMBER/${{ github.ref_name }}/g' ScopeSequencing.tex
|
echo "Release for tag ${{ github.ref_name }} already exists - will update it"
|
||||||
- run: pdflatex -jobname=ScopeSequencing-${{ github.ref_name }} ScopeSequencing.tex
|
else
|
||||||
- run: ls -al .
|
echo "exists=false" >> $GITHUB_OUTPUT
|
||||||
- name: release
|
echo "Release for tag ${{ github.ref_name }} does not exist - will create it"
|
||||||
uses: actions/create-release@v1
|
fi
|
||||||
id: create_release
|
|
||||||
with:
|
|
||||||
draft: false
|
|
||||||
prerelease: false
|
|
||||||
release_name: ${{ steps.get_version.outputs.VERSION }}
|
|
||||||
tag_name: ${{ github.ref }}
|
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Install LaTeX dependencies
|
||||||
- name: Upload Keywords
|
run: |
|
||||||
uses: actions/upload-release-asset@v1
|
sudo add-apt-repository -y ppa:sunderme/texstudio
|
||||||
env:
|
sudo apt install texlive-latex-extra
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
|
||||||
|
- name: Debug - Show current directory
|
||||||
|
run: |
|
||||||
|
echo $PWD
|
||||||
|
ls -al ./
|
||||||
|
ls -al ../
|
||||||
|
|
||||||
|
- name: Replace version in LaTeX file
|
||||||
|
run: sed -i 's/VERSIONNUMBER/${{ github.ref_name }}/g' ScopeSequencing.tex
|
||||||
|
|
||||||
|
- name: Generate PDF
|
||||||
|
run: pdflatex -jobname=ScopeSequencing-${{ github.ref_name }} ScopeSequencing.tex
|
||||||
|
|
||||||
|
- name: Debug - Show generated files
|
||||||
|
run: ls -al .
|
||||||
|
|
||||||
|
- name: Create or Update Release
|
||||||
|
uses: softprops/action-gh-release@v1
|
||||||
with:
|
with:
|
||||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
files: ScopeSequencing-${{ github.ref_name }}.pdf
|
||||||
asset_path: ScopeSequencing-${{ github.ref_name }}.pdf
|
draft: false
|
||||||
asset_name: ScopeSequencing-${{ github.ref_name }}.pdf
|
prerelease: false
|
||||||
asset_content_type: application/binary
|
name: Release ${{ github.ref_name }}
|
||||||
|
# This action automatically handles existing releases by updating them
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue