mirror of
https://github.com/TechnoIndian/ApkPatcher.git
synced 2026-10-03 22:42:25 +02:00
57 lines
1.4 KiB
YAML
57 lines
1.4 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- '*'
|
|
|
|
workflow_dispatch:
|
|
inputs:
|
|
version:
|
|
description: 'Version'
|
|
required: false
|
|
default: ''
|
|
type: string
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@v5
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Get version
|
|
run: |
|
|
if [[ "${{ github.event_name }}" == "workflow_dispatch" && -n "${{ github.event.inputs.version }}" ]]; then
|
|
VERSION_TAG="${{ github.event.inputs.version }}"
|
|
echo "Using manually provided version: $VERSION_TAG"
|
|
else
|
|
VERSION_TAG=$(git describe --tags --always)
|
|
echo "Extracted version from git: $VERSION_TAG"
|
|
fi
|
|
echo "$VERSION_TAG" > VERSION
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: "3.x"
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install build twine
|
|
|
|
- name: Build the package
|
|
run: |
|
|
python -m build
|
|
|
|
- name: Publish
|
|
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
|
|
env:
|
|
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
|
|
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
|
|
run: |
|
|
python -m twine upload dist/* |