Skip to content

Commit

Permalink
Merge pull request #16 from CallyCo-io/chore/release
Browse files Browse the repository at this point in the history
Generate Release from Tag
  • Loading branch information
techman83 authored Mar 24, 2024
2 parents 61222b1 + 506bf53 commit 8d47eb0
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 1 deletion.
75 changes: 75 additions & 0 deletions .github/workflows/release-cally.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
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@v3
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@v3
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: Get distribution
uses: actions/download-artifact@v3
with:
name: package-${{ needs.build-artifact.outputs.version }}
path: dist
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
draft: false
files: |
dist/cally-${{ needs.build-artifact.outputs.version }}.tar.gz
1 change: 1 addition & 0 deletions .github/workflows/test-cally.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Test

on:
workflow_call:
push:
branches-ignore:
- main
Expand Down
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ authors = [
]
description = "A config as infrastructure foundation for your Internal Developer Platform"
readme = "README.md"
license = {file = "LICENSE.md"}
license = {file = "LICENSE"}

[project.urls]
Repository = "https://github.com/CallyCo-io/Cally/"
Issues = "https://github.com/CallyCo-io/Cally/issues"

[project.optional-dependencies]
development = [
Expand Down

0 comments on commit 8d47eb0

Please sign in to comment.