This repository was archived by the owner on Apr 30, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (53 loc) · 2.02 KB
/
release_utils.yml
File metadata and controls
56 lines (53 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Publish utils to external repositories
on:
workflow_dispatch:
inputs:
utils:
type: choice
description: Release package from utils
options:
- utils/graphql-pydantic-converter
jobs:
build:
name: Validate api packages
runs-on: ubuntu-latest
timeout-minutes: 5
defaults:
run:
working-directory: ${{ inputs.utils }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- uses: abatilo/actions-poetry@v2
with:
poetry-version: "2.0.1"
- name: Package naming
run: |
echo "PACKAGE_NAME=$(poetry version --no-interaction | cut -d ' ' -f 1)" >> "$GITHUB_ENV"
echo "PACKAGE_VERSION=$(poetry version --no-interaction --short)" >> "$GITHUB_ENV"
echo "RELEASE_TAG=$(poetry version --no-interaction | sed 's| |_v|g')" >> "$GITHUB_ENV"
- name: Docker image naming
run: |
echo "IMAGE_NAME=frinx/${{ env.PACKAGE_NAME }}:${{ env.PACKAGE_VERSION }}" >> "$GITHUB_ENV"
- name: Poetry publish
run: poetry publish -u "__token__" -p "${{ secrets.PYPI_TOKEN }}" --build
- name: Build docker image
run: docker build . --file Dockerfile --build-arg git_commit=$(git rev-parse HEAD) --tag ${{ env.IMAGE_NAME }}
- name: Log into docker hub
run: echo "${{ secrets.DOCKER_HUB_PASSWORD }}" | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin
- name: Push docker image
run: docker push ${{ env.IMAGE_NAME }}
- name: Create Release
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.RELEASE_TAG }}
release_name: Release ${{ env.RELEASE_TAG }}
body: |
- Release of ${{ env.PACKAGE_NAME }}:${{ env.PACKAGE_VERSION }} for image with tag ${{ env.IMAGE_NAME }}
draft: false
prerelease: false