Skip to content

Commit 636383a

Browse files
authored
Feature: auto-release of theme and slides structure (#10)
* feat: added custom code syntax highlighting style and enhanced README with compilation variables * feat: added GitHub Actions workflow for test release on feature branch * Test release automation * feat: implement auto-release workflow and configuration for versioning * chore: comment out condition for AGHMD release preparation step (test) * Test release automation * feat: update auto-release workflow to include time in versioning and rename release steps for clarity * chore: comment out conditions for AGHMD release preparation steps * feat: refactor auto-release workflow to create combined release and improve versioning * fix: update ZIP file naming in auto-release workflow for consistency * feat: enhance auto-release workflow to dynamically include/exclude files based on configuration * Test release automation * fix: update branch trigger for auto-release workflow to main * feat: added highlight-styles to included files in release configuration
1 parent d7679da commit 636383a

File tree

2 files changed

+95
-0
lines changed

2 files changed

+95
-0
lines changed

.github/workflows/auto-release.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Auto Create Combined Release
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
jobs:
8+
create-release:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout repo
13+
uses: actions/checkout@v3
14+
15+
- name: Install yq for YAML parsing
16+
run: |
17+
YQ_VERSION=v4.45.1
18+
wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64
19+
chmod +x /usr/local/bin/yq
20+
21+
22+
- name: Read major version and generate date-based minor version
23+
id: version
24+
run: |
25+
MAJOR=$(yq '.major' .release-config.yaml)
26+
DATE=$(date +%y%m%d)
27+
TIME=$(date +%H%M)
28+
echo "version=${MAJOR}.${DATE}.${TIME}" >> $GITHUB_OUTPUT
29+
30+
- name: Prepare Slides Structure ZIP
31+
run: |
32+
mkdir -p slides-structure
33+
34+
INCLUDE=$(yq '.release.slides_structure.include[]' .release-config.yaml)
35+
for path in $INCLUDE; do
36+
cp -r "$path" slides-structure/
37+
done
38+
EXCLUDE=$(yq '.release.slides_structure.exclude[]' .release-config.yaml)
39+
for path in $EXCLUDE; do
40+
rm -rf "slides-structure/$path" || true
41+
done
42+
43+
cd slides-structure && zip -r ../slides-structure.zip .
44+
45+
- name: Prepare AGHMD Beamer Theme ZIP
46+
run: |
47+
mkdir -p beamer-theme-aghmd
48+
49+
INCLUDE=$(yq '.release.aghmd_beamer_theme.include[]' .release-config.yaml)
50+
for path in $INCLUDE; do
51+
cp -r "$path" beamer-theme-aghmd/
52+
done
53+
EXCLUDE=$(yq '.release.aghmd_beamer_theme.exclude[]' .release-config.yaml)
54+
for path in $EXCLUDE; do
55+
rm -rf "beamer-theme-aghmd/$path" || true
56+
done
57+
58+
cd beamer-theme-aghmd && zip -r ../beamer-theme-aghmd.zip .
59+
60+
- name: Create Git tag for combined release
61+
run: |
62+
git config user.name "github-actions"
63+
git config user.email "github-actions@users.noreply.github.com"
64+
TAG="combined-release-v${{ steps.version.outputs.version }}"
65+
git tag $TAG
66+
git push origin $TAG
67+
env:
68+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69+
70+
- name: Create GitHub Release with both ZIPs
71+
uses: softprops/action-gh-release@v2
72+
with:
73+
name: "Combined Release - v${{ steps.version.outputs.version }}"
74+
tag_name: "combined-release-v${{ steps.version.outputs.version }}"
75+
files: |
76+
slides-structure.zip
77+
beamer-theme-aghmd.zip
78+
env:
79+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.release-config.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
major: 0
2+
3+
release:
4+
slides_structure:
5+
include:
6+
- csl
7+
- filters
8+
- justfile
9+
- highlight-styles
10+
- src/
11+
exclude:
12+
- src/img/*
13+
aghmd_beamer_theme:
14+
include:
15+
- AGHMD
16+
- justfile

0 commit comments

Comments
 (0)