Merge pull request #18 from n3rada/dev #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: deploy | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: deploy | |
path: | | |
assets/ | |
latex-files/ | |
packages/ | |
ressources-graphiques/ | |
.latexmkrc | |
Makefile | |
rapportUTT.tex | |
rUTT.cls | |
- name: Create draft release | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
zip -qr deploy.zip \ | |
assets/ \ | |
latex-files/ \ | |
packages/ \ | |
ressources-graphiques/ \ | |
.latexmkrc \ | |
Makefile \ | |
rapportUTT.tex \ | |
rUTT.cls && \ | |
for DRAFT_TAG in $(gh release list --limit 100 --json tagName,isDraft --jq '.[] | select(.isDraft) | .tagName'); do \ | |
gh release delete "$DRAFT_TAG" -y; \ | |
done; YEAR_MONTH=$(date "+%Y.%-m"); COUNT=0; \ | |
for TAG in $(gh release list --exclude-drafts --limit 100 | awk '{print $1}'); do \ | |
case "$TAG" in v"$YEAR_MONTH".*) COUNT=$((COUNT + 1));; esac; \ | |
done; RELEASE_NUMBER=$((COUNT + 1)); \ | |
gh release create --draft --generate-notes "v$YEAR_MONTH.$RELEASE_NUMBER" deploy.zip |