Skip to content

Commit

Permalink
Add action to generate tarball with microtex included.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kasper Peeters committed Oct 25, 2024
1 parent bd98994 commit ba939ea
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 1 deletion.
49 changes: 49 additions & 0 deletions .github/workflows/tarball.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# This is a build which gets triggered on every release, to
# generate a tarball which includes all submodules.

name: Tarball

# on:
# release:
# types: [created]

on: [push]

jobs:
build:

runs-on: ubuntu-latest

steps:
- name: Checkout Cadabra
uses: actions/checkout@v4

- name: Set up GitHub CLI
run: |
sudo apt-get update
sudo apt-get install -y gh
- name: Authenticate GitHub CLI
run: gh auth setup-git
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create tarball
run: |
export CDB_MAJOR=`cat cmake/version.cmake |grep 'MAJOR '|sed -e 's/[^ ]* \([0-9]*\).*/\1/'`
export CDB_MINOR=`cat cmake/version.cmake |grep 'MAJOR '|sed -e 's/[^ ]* \([0-9]*\).*/\1/'`
export CDB_PATCH=`cat cmake/version.cmake |grep 'MAJOR '|sed -e 's/[^ ]* \([0-9]*\).*/\1/'`
export VERSION=${CDB_MAJOR}.${CDB_MINOR}.${CDB_PATCH}
echo "VERSION=$VERSION" >> $GITHUB_ENV
mkdir -p submodules
cd submodules
git clone https://github.com/kpeeters/MicroTeX.git microtex
cd ../..
tar zcf cadabra2-${VERSION}-inclusive.tar.gz --exclude ".git" cadabra2
- name: Upload tarball to assets
run: |
gh release upload "${{ env.VERSION }}" ${{ github.workspace }}/cadabra2-${VERSION}-inclusive.tar.gz --clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

2 changes: 1 addition & 1 deletion cmake/version.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
set(CADABRA_VERSION_MAJOR 2)
set(CADABRA_VERSION_MINOR 5)
set(CADABRA_VERSION_PATCH 7)
set(CADABRA_VERSION_PATCH 6)
set(CADABRA_VERSION_TWEAK 0)
set(CADABRA_VERSION_SEM ${CADABRA_VERSION_MAJOR}.${CADABRA_VERSION_MINOR}.${CADABRA_VERSION_PATCH})
set(COPYRIGHT_YEARS "2001-2024")
Expand Down

0 comments on commit ba939ea

Please sign in to comment.