Skip to content

Commit

Permalink
update github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
kolosovpetro committed Sep 25, 2024
1 parent 6d1b96a commit d4d0ab9
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 139 deletions.
93 changes: 14 additions & 79 deletions .github/workflows/build-and-deploy-pdf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,85 +7,20 @@ on:
workflow_dispatch:

env:
FILE_NAME: "AStudyOnDynamicEquations"
ACTIONS_RUNNER_DEBUG: false
# REQUIRES ${{ secrets.GH_ACCESS_TOKEN }} defined in secrets

jobs:
build-pdf:
runs-on: ubuntu-latest
name: Build and Deploy PDF

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v1.1.1
with:
versionSpec: '5.x'

- name: Determine Version
uses: gittools/actions/gitversion/execute@v1.1.1

- name: Print SemVer
run: |
echo "SemVer: ${{ env.GitVersion_SemVer }}"
echo "BranchName: ${{ env.GitVersion_BranchName }}"
echo "ShortSha: ${{ env.GitVersion_ShortSha }}"
newVersion="${{ env.GitVersion_SemVer }}+${{ env.GitVersion_BranchName }}.${{ env.GitVersion_ShortSha }}"
echo "Next version: $newVersion"
- name: Update version.tex
shell: bash
run: |
newVersion="${{ env.GitVersion_SemVer }}+${{ env.GitVersion_BranchName }}.${{ env.GitVersion_ShortSha }}"
sed -i "s|Local-0.1.0|$newVersion|" "src/sections/version.tex"
- name: Build PDF
uses: xu-cheng/latex-action@v3
with:
root_file: "${{ env.FILE_NAME }}.tex"
working_directory: src

- name: List src
run: |
ls -lsa src
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: "${{ env.FILE_NAME }}-${{ env.GitVersion_InformationalVersion }}"
path: |
src/${{ env.FILE_NAME }}.tex
src/${{ env.FILE_NAME }}.bbl
src/${{ env.FILE_NAME }}.bib
src/sections
- name: Upload artifacts PDF
uses: actions/upload-artifact@v4
with:
name: "${{ env.FILE_NAME }}-PDF-${{ env.GitVersion_InformationalVersion }}"
path: |
src/${{ env.FILE_NAME }}.pdf
- name: Clone repository and add document
run: |
git clone https://$TOKEN@github.com/kolosovpetro/kolosovpetro.github.io.git ~/kolosovpetro.github.io
cp src/${{ env.FILE_NAME }}.pdf ~/kolosovpetro.github.io/pdf/${{ env.FILE_NAME }}.pdf
env:
TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}

- name: Commit document changes if any
run: |
cd ~/kolosovpetro.github.io
git config --global user.name "$USERNAME"
git config --global user.email "$EMAIL"
git add .
git commit -m "$MESSAGE"
git push
env:
USERNAME: "kolosovpetro"
EMAIL: "kolosovp94@gmail.com"
MESSAGE: "CICD deploy of ${{ env.FILE_NAME }} PDF document"
build-deploy-pdf:
uses: kolosovpetro/github-latex-template/.github/workflows/build-and-deploy-pdf-template.yml@main
secrets: inherit
with:
file_name: 'AStudyOnDynamicEquations'
runs_on: 'ubuntu-latest'
workflow_name: 'Build PDF'
build_assets_path: |
src/AStudyOnDynamicEquations.tex
src/AStudyOnDynamicEquations.bbl
src/AStudyOnDynamicEquations.bib
src/sections
working_directory_for_latex: 'src'
69 changes: 11 additions & 58 deletions .github/workflows/build-pdf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,65 +14,18 @@ on:
workflow_dispatch:

env:
FILE_NAME: "AStudyOnDynamicEquations"
ACTIONS_RUNNER_DEBUG: false

jobs:
build-pdf:
runs-on: ubuntu-latest
name: Build PDF

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v1.1.1
with:
versionSpec: '5.x'

- name: Determine Version
uses: gittools/actions/gitversion/execute@v1.1.1

- name: Print SemVer
run: |
echo "SemVer: ${{ env.GitVersion_SemVer }}"
echo "BranchName: ${{ env.GitVersion_BranchName }}"
echo "ShortSha: ${{ env.GitVersion_ShortSha }}"
newVersion="${{ env.GitVersion_SemVer }}+${{ env.GitVersion_BranchName }}.${{ env.GitVersion_ShortSha }}"
echo "Next version: $newVersion"
- name: Update version.tex
shell: bash
run: |
newVersion="${{ env.GitVersion_SemVer }}+${{ env.GitVersion_BranchName }}.${{ env.GitVersion_ShortSha }}"
sed -i "s|Local-0.1.0|$newVersion|" "src/sections/version.tex"
- name: Build PDF
uses: xu-cheng/latex-action@v3
with:
root_file: "${{ env.FILE_NAME }}.tex"
working_directory: src

- name: List src
run: |
ls -lsa src
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: "${{ env.FILE_NAME }}-${{ env.GitVersion_InformationalVersion }}"
path: |
src/${{ env.FILE_NAME }}.tex
src/${{ env.FILE_NAME }}.bbl
src/${{ env.FILE_NAME }}.bib
src/sections
- name: Upload artifacts PDF
uses: actions/upload-artifact@v4
with:
name: "${{ env.FILE_NAME }}-PDF-${{ env.GitVersion_InformationalVersion }}"
path: |
src/${{ env.FILE_NAME }}.pdf
uses: kolosovpetro/github-latex-template/.github/workflows/build-pdf-template.yml@main
with:
file_name: 'AStudyOnDynamicEquations'
runs_on: 'ubuntu-latest'
workflow_name: 'Build PDF'
build_assets_path: |
src/AStudyOnDynamicEquations.tex
src/AStudyOnDynamicEquations.bbl
src/AStudyOnDynamicEquations.bib
src/sections
working_directory_for_latex: 'src'
11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,24 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning v2.0.0](https://semver.org/spec/v2.0.0.html).

## [1.0.2] - 2024-09-25

## Changed

- Update build GitHub Actions
- Update deploy GitHub Actions

## [1.0.1] - 2024-09-18

### Changed
## Changed

- Remove function `mu` from definitions
- Remove redundant sections
- Typo fixes

## [1.0.0] - 2024-09-18

### Changed
## Changed

- Change bibliography style
- Update CI/CD
Expand Down

0 comments on commit d4d0ab9

Please sign in to comment.