Update release notes
This commit is contained in:
parent
5aaa64bc14
commit
a2818a9f88
1 changed files with 22 additions and 9 deletions
|
@ -21,45 +21,59 @@ jobs:
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.RELEASE_TOKEN }} # Use RELEASE_TOKEN instead of GITHUB_TOKEN
|
token: ${{ secrets.RELEASE_TOKEN }} # Use RELEASE_TOKEN instead of GITHUB_TOKEN
|
||||||
|
|
||||||
# Step 2: Install latex dependencies
|
# Step 2: Install latex dependencies
|
||||||
- name: Install LaTeX Dependencies
|
- name: Install LaTeX Dependencies
|
||||||
run: |
|
run: |
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get install -y texlive texlive-latex-extra texlive-fonts-recommended latexmk
|
apt-get install -y texlive texlive-latex-extra texlive-fonts-recommended latexmk
|
||||||
|
|
||||||
# Step 3: Create build directory
|
# Step 3: Create build directory
|
||||||
- name: Create dist directory
|
- name: Create dist directory
|
||||||
run: |
|
run: |
|
||||||
mkdir -p dist
|
mkdir -p dist
|
||||||
# Step 3: Compile the LaTeX.
|
|
||||||
|
# Step 4: Compile the LaTeX document
|
||||||
- name: Compile LaTeX document
|
- name: Compile LaTeX document
|
||||||
run: |
|
run: |
|
||||||
latexmk -pdf -jobname=dist/leonardo-murca-resume main.tex
|
latexmk -pdf -jobname=dist/leonardo-murca-resume main.tex
|
||||||
rm -f dist/leonardo-murca-resume.aux dist/leonardo-murca-resume.log dist/leonardo-murca-resume.out dist/leonardo-murca-resume.fls dist/leonardo-murca-resume.fdb_latexmk
|
rm -f dist/leonardo-murca-resume.aux dist/leonardo-murca-resume.log dist/leonardo-murca-resume.out dist/leonardo-murca-resume.fls dist/leonardo-murca-resume.fdb_latexmk
|
||||||
|
|
||||||
# Step 4: Get commit messages for the release (from the tag)
|
# Step 5: Get commit messages for the release (from the tag)
|
||||||
- name: Get commit messages for the release
|
- name: Get commit messages for the release
|
||||||
id: get_commit_messages
|
id: get_commit_messages
|
||||||
run: |
|
run: |
|
||||||
|
# Get the current tag name (e.g., v1.0.0)
|
||||||
TAG_NAME=${GITHUB_REF#refs/tags/}
|
TAG_NAME=${GITHUB_REF#refs/tags/}
|
||||||
|
|
||||||
|
# Find the commit where this tag was created
|
||||||
TAG_COMMIT=$(git rev-list -n 1 $TAG_NAME)
|
TAG_COMMIT=$(git rev-list -n 1 $TAG_NAME)
|
||||||
|
|
||||||
|
# Find the previous tag (if it exists)
|
||||||
PREVIOUS_TAG=$(git describe --tags --abbrev=0 --match "v*" $TAG_COMMIT^ 2>/dev/null || echo "")
|
PREVIOUS_TAG=$(git describe --tags --abbrev=0 --match "v*" $TAG_COMMIT^ 2>/dev/null || echo "")
|
||||||
|
|
||||||
|
# Get commit messages only for the current tag
|
||||||
if [ -z "$PREVIOUS_TAG" ]; then
|
if [ -z "$PREVIOUS_TAG" ]; then
|
||||||
COMMITS=$(git log --pretty=format:'- %s' $TAG_COMMIT)
|
# No previous tag, show all commits leading up to this tag
|
||||||
|
COMMITS=$(git log --pretty=format:'- %s' $TAG_COMMIT --no-merges)
|
||||||
else
|
else
|
||||||
COMMITS=$(git log $PREVIOUS_TAG..$TAG_COMMIT --pretty=format:'- %s')
|
# Show commits only between the previous tag and the current tag
|
||||||
|
COMMITS=$(git log $PREVIOUS_TAG..$TAG_NAME --pretty=format:'- %s' --no-merges)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Store commit messages in environment variable
|
||||||
echo "commits<<EOF" >> $GITHUB_ENV
|
echo "commits<<EOF" >> $GITHUB_ENV
|
||||||
echo "$COMMITS" >> $GITHUB_ENV
|
echo "$COMMITS" >> $GITHUB_ENV
|
||||||
echo "EOF" >> $GITHUB_ENV
|
echo "EOF" >> $GITHUB_ENV
|
||||||
|
|
||||||
# Step 5: Upload the compiled PDF as a release asset.
|
# Step 6: Upload the compiled PDF as a release asset
|
||||||
- name: Upload PDF to Release
|
- name: Upload PDF to Release
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: leonardo-murca-resume.pdf # The file to upload as the release asset.
|
name: leonardo-murca-resume.pdf # The file to upload as the release asset
|
||||||
path: dist/leonardo-murca-resume.pdf # Path to the compiled PDaF
|
path: dist/leonardo-murca-resume.pdf
|
||||||
|
|
||||||
# Step 6: Create release
|
# Step 7: Create release
|
||||||
- name: Create release
|
- name: Create release
|
||||||
uses: actions/forgejo-release@v2
|
uses: actions/forgejo-release@v2
|
||||||
with:
|
with:
|
||||||
|
@ -70,4 +84,3 @@ jobs:
|
||||||
repo: leomurca/resume
|
repo: leomurca/resume
|
||||||
title: "Release ${{ github.ref_name }}"
|
title: "Release ${{ github.ref_name }}"
|
||||||
release-notes: "${{ env.commits }}"
|
release-notes: "${{ env.commits }}"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue