Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hiroyaonoe committed Feb 11, 2024
1 parent 26c9108 commit ff660da
Showing 1 changed file with 32 additions and 18 deletions.
50 changes: 32 additions & 18 deletions .github/workflows/latex.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,6 @@ jobs:
echo "FILENAME=${FILENAME}" >> $GITHUB_OUTPUT
- name: "Commit and Push main.pdf"
run: |
mv main.pdf main_tmp.pdf
git config user.name "$(git --no-pager log --format=format:'%an' -n 1)"
git config user.email "$(git --no-pager log --format=format:'%ae' -n 1)"
git fetch
if git branch -a | grep -q "remotes/origin/main-pdf"; then
git checkout -t origin/main-pdf
else
git checkout --orphan main-pdf
git rm --cached -r .
fi
mv main_tmp.pdf main.pdf
git add -f main.pdf
git commit -m "main.pdf: ${{ github.sha }}"
git push origin main-pdf
- name: "Rename main.pdf"
run: mv main.pdf ${{ steps.filename.outputs.FILENAME }}.pdf

Expand All @@ -61,7 +44,7 @@ jobs:
with:
name: ${{ steps.filename.outputs.FILENAME }}
path: ${{ steps.filename.outputs.FILENAME }}.pdf

release:
runs-on: ubuntu-latest
needs: build
Expand All @@ -87,3 +70,34 @@ jobs:
uses: softprops/action-gh-release@v1
with:
files: ${{ steps.filename.outputs.FILENAME }}

commit:
runs-on: ubuntu-latest
needs: build
if: "!startsWith(github.ref, 'refs/tags/')"
steps:
- uses: actions/checkout@v2

- name: "Download artifact main.pdf"
uses: actions/download-artifact@v3
with:
name: ${{ needs.build.outputs.filename }}

- name: "Rename main.pdf"
run: mv ${{ needs.build.outputs.filename }}.pdf main_tmp.pdf

- name: "Commit and Push main.pdf"
run: |
git config user.name "$(git --no-pager log --format=format:'%an' -n 1)"
git config user.email "$(git --no-pager log --format=format:'%ae' -n 1)"
git fetch
if git branch -a | grep -q "remotes/origin/main-pdf"; then
git checkout -f -t origin/main-pdf
else
git checkout -f --orphan main-pdf
git rm --cached -r .
fi
mv main_tmp.pdf main.pdf
git add -f main.pdf
git commit -m "main.pdf: ${{ github.sha }}"
git push origin main-pdf

0 comments on commit ff660da

Please sign in to comment.