Skip to content

Commit

Permalink
Merge pull request #18 from sebastienrousseau/feat/pain001
Browse files Browse the repository at this point in the history
fix(pain001): updates on ci
  • Loading branch information
sebastienrousseau authored Mar 18, 2023
2 parents 5614c70 + 64996e4 commit 857cd53
Showing 1 changed file with 29 additions and 16 deletions.
45 changes: 29 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ jobs:
python -m pip install -r requirements.txt
python -m pip install pytest pytest-cov
# Run pytest with code coverage measurement
- name: ❯ Run pytest with code coverage 🧪
# Run pytest
- name: ❯ Run pytest 🧪
run: pytest --cov=pain001 --cov-report=xml

# Upload code coverage report to Codecov
Expand Down Expand Up @@ -109,6 +109,32 @@ jobs:
echo "VERSION=$NEW_VERSION" >> $GITHUB_ENV
shell: /bin/bash -e {0}

# Generate the changelog based on git log and template file
- name: Generate Changelog 📚
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
run: |
# Append version information to CHANGELOG.md
echo "## Release v${{ env.VERSION }} - $(date +'%Y-%m-%d')" >> ${{ github.workspace }}/CHANGELOG.md
# Copy content of template file to CHANGELOG.md
cat TEMPLATE.md >> ${{ github.workspace }}/CHANGELOG.md
# Append git log to CHANGELOG.md
echo "$(git log --pretty=format:'%s' --reverse $(git describe --tags --abbrev=0)..HEAD)" >> ${{ github.workspace }}/CHANGELOG.md
# Append empty line to CHANGELOG.md
echo "" >> ${{ github.workspace }}/CHANGELOG.md
# Append artifact links to the changelog
- name: Append Artifact Links 🔗
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
run: |
echo "" >> ${{ github.workspace }}/CHANGELOG.md
echo "## Artifacts 🎁" >> ${{ github.workspace }}/CHANGELOG.md
for filename in dist/*; do
link="$(basename $filename)"
echo "* [$link](${{ env.RELEASES_URL }}/$link)" >> ${{ github.workspace }}/CHANGELOG.md
done
env:
RELEASES_URL: https://github.com/${{ github.repository }}/releases/download/v${{ env.VERSION }}

# Create a release
- name: Create Release 🚀
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
Expand All @@ -120,10 +146,9 @@ jobs:
tag_name: v${{ env.VERSION }}
release_name: Release v${{ env.VERSION }}
body_path: ${{ github.workspace }}/CHANGELOG.md
draft: false
draft: true
prerelease: false

# Upload release assets
- name: Upload Release Assets 📦
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
env:
Expand All @@ -138,15 +163,3 @@ jobs:
"${upload_url}?name=$(basename $file)"
done
# Generate the changelog based on git log and template file
- name: Generate Changelog 📚
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
run: |
# Append version information to CHANGELOG.md
echo "## Release v${{ env.VERSION }} - $(date +'%Y-%m-%d')" >> ${{ github.workspace }}/CHANGELOG.md
# Copy content of template file to CHANGELOG.md
cat TEMPLATE.md >> ${{ github.workspace }}/CHANGELOG.md
# Append git log to CHANGELOG.md
echo "$(git log --pretty=format:'%s' --reverse $(git describe --tags --abbrev=0)..HEAD)" >> ${{ github.workspace }}/CHANGELOG.md
# Append empty line to CHANGELOG.md
echo "" >> ${{ github.workspace }}/CHANGELOG.md

0 comments on commit 857cd53

Please sign in to comment.