Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Full Release on Continuous Delivery (#49) (#50) #52

Closed
wants to merge 1 commit into from
Closed
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
17 changes: 17 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name-template: 'Draft'
template: |
# What's Changed

$CHANGES

categories:
- title: '🚀 Features'
label: 'enhancement'
- title: '🐛 Bug Fixes'
label: 'bug'
- title: '📝 Documentation'
label: 'documentation'
collapse-after: 5

exclude-labels:
- 'skip-changelog'
35 changes: 31 additions & 4 deletions .github/workflows/continuous_delivery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ jobs:
- name: Extract version from pyproject.toml
id: extract_version
run: |
VERSION=$(poetry version -s)
VERSION=v$(poetry version -s)
echo "PACKAGE_VERSION=${VERSION}" >> $GITHUB_ENV
- name: Verify if version has changed
id: version_check
run: |
if [ $(git tag -l "v${{ env.PACKAGE_VERSION }}") ]; then
if [ $(git tag -l ${{ env.PACKAGE_VERSION }}") ]; then
echo "Version ${{ env.PACKAGE_VERSION }} already exists."
exit 0
fi
Expand All @@ -58,5 +58,32 @@ jobs:
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "GitHub Actions"
git tag "v${{ env.PACKAGE_VERSION }}"
git push origin "v${{ env.PACKAGE_VERSION }}"
git tag "${{ env.PACKAGE_VERSION }}"
git push origin "${{ env.PACKAGE_VERSION }}"
- name: Publish Draft Release
if: ${{ success() && matrix.python-version == 3.8 }}
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { data: releases } = await github.repos.listReleases({
owner: context.repo.owner,
repo: context.repo.repo,
});

const draftRelease = releases.find(r => r.draft && r.name === 'Draft');

if (draftRelease) {
await github.repos.updateRelease({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: draftRelease.id,
tag_name: process.env.PACKAGE_VERSION,
name: process.env.PACKAGE_VERSION,
draft: false
});
} else {
core.setFailed(`Draft release named "Draft" not found.`);
};
env:
PACKAGE_VERSION: ${{ env.PACKAGE_VERSION }}
24 changes: 24 additions & 0 deletions .github/workflows/pull_request_style_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Pull Request Style Check

on:
pull_request:
types:
- opened
- synchronize
- reopened
- labeled
- unlabeled
- edited
branches:
- develop


jobs:
check_cc_labels:
name: check conventional commits labels
runs-on: ubuntu-latest
steps:
- uses: danielchabr/[email protected]
with:
hasSome: bug, documentation, enhancement
githubToken: ${{ secrets.GITHUB_TOKEN }}
19 changes: 19 additions & 0 deletions .github/workflows/release_draft.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Release Draft

on:
push:
branches:
- develop

jobs:
draft_release:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Draft a new release
uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}