Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- master
pull_request:
branches:
branches:
- master

jobs:
Expand Down
78 changes: 13 additions & 65 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,73 +1,21 @@
name: Release

on:
workflow_call:
inputs:
tag_name:
required: true
type: string
wheel_file:
required: true
type: string
secrets:
pypi_token:
required: true
push:
tags:
- 'v*'

permissions:
contents: write

jobs:
release:
name: Release
runs-on: ubuntu-latest
env:
tag_name: ${{ inputs.tag_name }}
wheel_file: ${{ inputs.wheel_file }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Make a tag and create CHANGELOG.md
run: |
previous_tag=$(git -c 'versionsort.suffix=-' \
ls-remote --exit-code --refs --sort='version:refname' --tags origin '*.*.*' \
| tail --lines=1 \
| cut -d '/' -f 3)
echo "Tag $tag_name" will be created
git config user.name "GitHub Actions Bot"
git config user.email "<>"
git tag -a $tag_name -m "Updated by Github workflow"

echo "Change Log" > CHANGELOG.md
echo "-----------------" >> CHANGELOG.md
echo "All the commits since the last tag are as follows:" >> CHANGELOG.md
git log --pretty=oneline $previous_tag...$tag_name >> CHANGELOG.md
git push origin $tag_name


- name: Download dist artifact
uses: actions/download-artifact@v3
with:
name: ${{ inputs.wheel_file }}

- name: Place artifacts
run: |
mkdir dist/
mv $wheel_file dist/$wheel_file

# loads contents of the dist/ folder into PyPI
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_token }}
verbose: true

- name: Create Github Release
id: create-release
uses: actions/create-release@v1
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ inputs.tag_name }}
release_name: Release ${{ inputs.tag_name }}
draft: false
prerelease: false
body_path: ./CHANGELOG.md

GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ github.ref_name }}
run: |
gh release create "$TAG" --repo="$GITHUB_REPOSITORY" --title "release $TAG" --notes "release $TAG" --target $TAG
17 changes: 6 additions & 11 deletions .github/workflows/test-and-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
description: "wheel file name"
value: ${{ jobs.test-and-build.outputs.wheel_file }}
env:
PIPELINE_POETRY: '1.4.0'
PIPELINE_POETRY: '1.4.0'

jobs:
test-and-build:
Expand All @@ -26,7 +26,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Poetry Installation and configure
Expand All @@ -42,7 +42,7 @@ jobs:

- name: Install dependencies
run: |
poetry install
poetry install

- name: Run pytests
run: |
Expand All @@ -55,8 +55,8 @@ jobs:
cv aggregate test/aggregate_example.toml \
cvcreator/templates/example.toml \
cvcreator/templates/example.toml
python -m cvcreator --latex cvcreator/templates/example.toml output.tex
python -m cvcreator --latex cvcreator/templates/example.toml output.tex

- name: Check Package Release
id: pkg-version
run: |
Expand All @@ -73,7 +73,7 @@ jobs:
echo "skip_release=YES" >> $GITHUB_OUTPUT
fi

- name: Make a New Wheel file
- name: Make a New Wheel file
id: wheel
if: ${{ steps.pkg-version.outputs.skip_release == 'NO' }}
run: |
Expand All @@ -88,8 +88,3 @@ jobs:
path: dist
retention-days: 1