Skip to content

Merge pull request #37 from CallyCo-io/docs/fix-config-examples #17

Merge pull request #37 from CallyCo-io/docs/fix-config-examples

Merge pull request #37 from CallyCo-io/docs/fix-config-examples #17

Workflow file for this run

name: Release Cally
on:
push:
tags:
- "v*"
jobs:
test-cally:
uses: ./.github/workflows/test-cally.yaml
build-artifact:
runs-on: ubuntu-latest
needs: test-cally
outputs:
version: ${{ steps.set-version.outputs.version }}
steps:
- uses: actions/checkout@v4
- name: Set package version
id: set-version
run: echo "VERSION=$( echo $GITHUB_REF | sed 's/refs\/tags\/v//' )" >> $GITHUB_OUTPUT
- name: Write version
env:
VERSION: ${{ steps.set-version.outputs.version }}
run: |
echo "VERSION: $VERSION"
echo "VERSION = '$VERSION'" > src/cally/cli/_version.py
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install build
run: pip install build
- name: Build distribution
run: python -m build
- name: Save dist files
uses: actions/upload-artifact@v4
with:
name: package-${{ steps.set-version.outputs.version }}
path: dist
if-no-files-found: "error"
generate-pypi-release:
runs-on: ubuntu-latest
needs: build-artifact
environment:
name: pypi
url: https://pypi.org/p/cally
permissions:
id-token: write
steps:
- name: Get distribution
uses: actions/download-artifact@v4
with:
name: package-${{ needs.build-artifact.outputs.version }}
path: dist
- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1
generate-gh-release:
runs-on: ubuntu-latest
needs: build-artifact
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install git-changelog
run: pip install git-changelog
- name: Prepare release notes
run: |
PREVIOUS=$(git describe --abbrev=0 --tags $(git rev-list --tags --skip=1 --max-count=1))
git-changelog --filter-commits ${PREVIOUS}..v${{ needs.build-artifact.outputs.version }}
- name: Get distribution
uses: actions/download-artifact@v4
with:
name: package-${{ needs.build-artifact.outputs.version }}
path: dist
- name: Release
uses: softprops/action-gh-release@v2
with:
body_path: NOTES.md
files: |
dist/cally-${{ needs.build-artifact.outputs.version }}.tar.gz
build-tool-cache:
needs:
- build-artifact
- generate-gh-release
uses: ./.github/workflows/build-tool-cache.yaml
with:
version: ${{ needs.build-artifact.outputs.version }}