Skip to content

Commit

Permalink
Update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
yves-chevallier committed Jun 19, 2024
1 parent c9b2731 commit 630964e
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 6 deletions.
44 changes: 43 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,46 @@ jobs:
with:
name: exam
path: build
if-no-files-found: error
if-no-files-found: error

release:
name: Create Release
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags')
steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: pdf
path: dist
- name: Upload Exam
id: upload-pdf-report
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/exam.pdf
asset_name: exam.pdf
asset_content_type: application/pdf
- name: Upload Solution
id: upload-pdf-solution
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/solution.pdf
asset_name: solution.pdf
asset_content_type: application/pdf
9 changes: 4 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ EXECS=$(SRC:.c=.out)
CFLAGS=-Wall -Wextra -Werror -std=c11 -pedantic -O3 -g
TEXSRC=$(wildcard *.tex)

all: release
all: dist

config.tex: config.m.tex | config.yml ./tools/parse-yml.py
./tools/parse-yml.py config.yml > $@ < $<
Expand All @@ -20,9 +20,8 @@ solution.pdf: exam.tex FORCE | config.tex code $(TEXSRC)

code: $(EXECS)

release: assembly exam.pdf solution.pdf
mkdir -p release
cp p*.pdf $@
dist: exam.pdf solution.pdf
mkdir -p $@
cp exam.pdf solution.pdf $@

clean:
Expand All @@ -36,4 +35,4 @@ clean:
$(RM) -rf release
FORCE:

.PHONY: clean all assembly
.PHONY: clean all

0 comments on commit 630964e

Please sign in to comment.