Skip to content

Commit

Permalink
ci: Update GitHub workflows for versioning and release management
Browse files Browse the repository at this point in the history
- Add new GitHub workflows for versioning and releases
- Update release workflow to trigger on all tags instead of just main branch pushes
- Remove unnecessary jobs and dependencies from release workflow
  • Loading branch information
johnnyhuy committed May 19, 2024
1 parent 3ef3f06 commit e9e28b1
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 36 deletions.
42 changes: 6 additions & 36 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,21 @@ name: Release

on:
push:
branches:
- main
paths-ignore:
- 'docs/**'
- '*.md'
- LICENSE
- '.github/**'
tags:
- '*'

permissions: write-all

jobs:
draft-release:
runs-on: ubuntu-latest

outputs:
tag_name: ${{ steps.drafter.outputs.tag_name }}

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: release-drafter/release-drafter@v5
id: drafter
env:
VERSION: ${{ github.ref }}

jobs:
publish-package:
runs-on: ubuntu-latest
needs: draft-release

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
VERSION: ${{ needs.draft-release.outputs.tag_name }}

steps:
- uses: actions/checkout@v4
Expand All @@ -44,15 +27,13 @@ jobs:

publish-image:
runs-on: ubuntu-latest
needs: draft-release

strategy:
matrix:
arch: [linux/amd64, linux/arm64]

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ needs.draft-release.outputs.tag_name }}

steps:
- uses: actions/checkout@v4
Expand All @@ -62,15 +43,4 @@ jobs:
- uses: docker/setup-buildx-action@v3
- run: make publish-image
env:
DOCKER_DEFAULT_PLATFORM: ${{ matrix.arch }}

publish-release:
runs-on: ubuntu-latest
needs:
- publish-package
- publish-image

steps:
- uses: release-drafter/release-drafter@v5
with:
publish: true
DOCKER_DEFAULT_PLATFORM: ${{ matrix.arch }}
22 changes: 22 additions & 0 deletions .github/workflows/version.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Version

on:
push:
branches:
- main
paths-ignore:
- 'docs/**'
- '*.md'
- LICENSE
- '.github/**'

permissions: write-all

jobs:
version:
runs-on: ubuntu-latest

steps:
- uses: release-drafter/release-drafter@v5
with:
publish: true

0 comments on commit e9e28b1

Please sign in to comment.