Skip to content

Commit

Permalink
Test release workflow passing tag to docker workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
AliOsm committed Jun 29, 2024
1 parent 42ea478 commit 888b7e5
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 13 deletions.
25 changes: 13 additions & 12 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ on:
description: 'Tag'
required: true

workflow_run:
workflows: [Release Package to PyPI.org]
types:
- completed
workflow_call:
inputs:
tag:
required: true
type: string

jobs:
build-and-push-image:
Expand All @@ -30,15 +31,15 @@ jobs:
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GH_TOKEN }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Determine version tag
id: version-tag
run: |
INPUT_VALUE="${{ github.event.inputs.tagInput }}"
if [ -z "$INPUT_VALUE" ]; then
INPUT_VALUE="${{ github.ref_name }}"
if [ -n "${{ github.event.inputs.tagInput }}" ]; then
echo "tag=${{ github.event.inputs.tagInput }}" >> "$GITHUB_OUTPUT"
else
echo "tag=${{ inputs.tag }}" >> "$GITHUB_OUTPUT"
fi
echo "::set-output name=value::$INPUT_VALUE"
- name: Build and push
uses: docker/build-push-action@v3
with:
Expand All @@ -47,7 +48,7 @@ jobs:
push: true
tags: |
ghcr.io/ieasybooks/tafrigh:latest
ghcr.io/ieasybooks/tafrigh:${{ steps.version-tag.outputs.value }}
ghcr.io/ieasybooks/tafrigh:${{ steps.version-tag.outputs.tag }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build and push Wit image
Expand All @@ -60,7 +61,7 @@ jobs:
push: true
tags: |
ghcr.io/ieasybooks/tafrigh-wit:latest
ghcr.io/ieasybooks/tafrigh-wit:${{ steps.version-tag.outputs.value }}
ghcr.io/ieasybooks/tafrigh-wit:${{ steps.version-tag.outputs.tag }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build and push Whisper image
Expand All @@ -73,6 +74,6 @@ jobs:
push: true
tags: |
ghcr.io/ieasybooks/tafrigh-whisper:latest
ghcr.io/ieasybooks/tafrigh-whisper:${{ steps.version-tag.outputs.value }}
ghcr.io/ieasybooks/tafrigh-whisper:${{ steps.version-tag.outputs.tag }}
cache-from: type=gha
cache-to: type=gha,mode=max
8 changes: 8 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,11 @@ jobs:
python-version: 3.12
- run: python -m pip install build twine && python -m build
- uses: pypa/gh-action-pypi-publish@release/v1
call-docker-publish-workflow:
needs: build-and-publish
permissions:
contents: read
packages: write
uses: ./.github/workflows/docker-publish.yml
with:
tag: ${{ github.ref_name }}
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "tafrigh"
version = "1.4.4"
version = "1.4.13"
description = "تفريغ النصوص وإنشاء ملفات SRT و VTT باستخدام نماذج Whisper وتقنية wit.ai."
authors = ["EasyBooks <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit 888b7e5

Please sign in to comment.