Skip to content

Publish packages

Publish packages #159

Workflow file for this run

name: Publish packages
on:
push:
branches: [ V6-master ]
paths: [ '.github/publish.txt' ]
workflow_dispatch:
jobs:
publish-windows-package:
runs-on: windows-latest
steps:
- uses: actions/checkout@v5
- name: Set up Python 3.12 amd64
uses: actions/setup-python@v6
with:
python-version: '3.12'
architecture: x64
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m venv venv
venv\Scripts\python -m pip install --upgrade pip wheel setuptools
venv\Scripts\python -m pip install -r requirements.txt
venv\Scripts\python -m pip install pyinstaller
- name: Build and publish package
env:
SECRETID: ${{ secrets.SECRETID }}
SECRETKEY: ${{ secrets.SECRETKEY }}
run: |
venv\Scripts\Activate.ps1
venv\Scripts\python run_build.py --type package --upload
publish-linux-package:
runs-on: ubuntu-latest
container: ubuntu:24.04
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Install system dependencies (Debian/Ubuntu)
run: |
apt-get update
apt-get install -y build-essential wget curl unzip
- name: Set up Python 3.12
uses: actions/setup-python@v6
with:
python-version: '3.12'
- name: Create virtual environment and install dependencies
run: |
python -m venv venv
. venv/bin/activate
pip install --upgrade pip wheel setuptools
pip install -r requirements.txt
pip install pyinstaller
- name: Build and publish Linux package
env:
SECRETID: ${{ secrets.SECRETID }}
SECRETKEY: ${{ secrets.SECRETKEY }}
PLATFORM: linux-x64
run: |
. venv/bin/activate
python run_build.py --type package --upload
publish-docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Get version from publish.txt
run: |
VERSION=$(cat .github/publish.txt | sed 's/^v//')
echo "VERSION=${VERSION}" >> $GITHUB_ENV
echo "VERSION=${VERSION}"
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: amiyabot/amiyabot:${{ env.VERSION }}, amiyabot/amiyabot:latest