Skip to content
This repository has been archived by the owner on Aug 23, 2023. It is now read-only.

Commit

Permalink
Create a monolithic workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
DanySK authored Dec 18, 2020
1 parent 39f7846 commit 464137e
Showing 1 changed file with 49 additions and 14 deletions.
63 changes: 49 additions & 14 deletions .github/workflows/build-and-deploy-latex.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,55 @@ jobs:
echo "Delivering file $pdf"
gh release upload "$TAG" "$pdf" --clobber
done <"success-list"
Automerge:
needs: Build-LaTeX
Deploy-Archives:
runs-on: ubuntu-latest
if: always()
steps:
- name: automerge
uses: "DanySK/yaagha@master"
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: true
- name: Fetch tags
shell: bash
run: git fetch --tags -f
- name: Autotag
uses: DanySK/semver-autotag-action@master
- name: Remove PMD/Checkstyle/Spotbugs configuration from the first labs
run: ./cleanup_project_files.rb
- name: Create archives
run: |
for file in workspace/*/; do
name="${file#*/}"
echo Creating "${name%*/}.zip" from $file
zip -r "${name%*/}.zip" "$file"
done
- name: Release
if: ${{ startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' }}
env:
GITHUB_TOKEN: "${{ secrets.AUTOMERGE_TOKEN }}"
MERGE_FORKS: "false"
MERGE_LABELS: "version-upgrade"
BLOCK_LABELS: "blocked, wontfix, invalid"
MERGE_METHOD: "rebase"
CLOSE_ON_CONFLICT: "true"
DELETE_BRANCH_ON_CLOSE: "true"
GIT_USER_NAME: "Danilo Pianini"
GIT_USER_EMAIL: "danilo.pianini@gmail.com"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG=$(git describe --tags --exact-match HEAD)
hub release create -m "$(git tag -l --format='%(contents)' "$TAG")" "$TAG" || true
ls -ahl
for file in $(find ~+ -name \*.zip); do
echo "Delivering file $file"
gh release upload "$TAG" "$file" --clobber
done
Refresh-Latest-Release:
runs-on: ubuntu-latest
needs: [Build-LaTeX, Deploy-Archives]
steps:
- name: Deploy
env:
GITHUB_TOKEN: ${{ secrets.AUTOMERGE_TOKEN }}
run: |
latest=$(gh release list -R APICe-at-DISI/OOP-Lab -L 1 | grep -Po 'Latest\s*\K(.*?)\s')
echo Latest release is $latest, downloading
gh release download $latest -R APICe-at-DISI/OOP-Lab
echo Create destination release if needed
gh release create -t "Release $latest" $latest -R APICe-at-DISI/OOP-Lab-public || true
for file in $(ls); do
echo "Delivering file $file"
gh release upload -R 'APICe-at-DISI/OOP-Lab-public' $latest "$file" --clobber
done

0 comments on commit 464137e

Please sign in to comment.