Skip to content

👷 ci(package name): ubuntu to linux #83

👷 ci(package name): ubuntu to linux

👷 ci(package name): ubuntu to linux #83

Workflow file for this run

name: Release
on:
push:
paths:
- src/constants.py
workflow_dispatch:
jobs:
prepare:
name: prepare
runs-on: ubuntu-latest
defaults:
run:
shell: bash
outputs:
VERSION: ${{ steps.get_variables.outputs.VERSION }}
SET_PRE_RELEASE: ${{ steps.get_variables.outputs.SET_PRE_RELEASE }}
CONTINUE: ${{ steps.get_variables.outputs.CONTINUE }}
LAST_COMMIT: ${{ steps.last-commit.outputs.message }}
steps:
- name: Checkout repo
uses: actions/checkout@main
- name: Prepare Version & Set Pre Release
id: get_variables
run: scripts/checkRelease.sh
- name: Get last commit message
id: last-commit
run: echo "message=$(git log -1 --pretty=%s)" >> $GITHUB_OUTPUT
build:
name: build
needs: prepare
strategy:
fail-fast: false
matrix:
os:
- ubuntu
- windows
- macos
runs-on: ${{ matrix.os }}-latest
timeout-minutes: 10
if: ${{ needs.prepare.outputs.CONTINUE == 'true' }}
steps:
- name: get OS lowercase
id: get_os
run: echo "OS_LOWER=${RUNNER_OS,,}" >> $GITHUB_ENV
- name: Checkout repo
uses: actions/checkout@main
- name: Install python
uses: actions/setup-python@main
with:
cache: pip
python-version: "3.12"
- name: Install dependacies
run: pip install -r requirements/requirements.txt && pip install pyinstaller
- name: Build for ${{ runner.os }}
run: pyinstaller --noconfirm --onefile --console --icon "assets/images/VNU_HCM_LOGO-256.ico" --name "VNULIB-Downloader-${{ env.OS_LOWER }}" --log-level "INFO" --add-data "src/:src/" --add-data "config-sample.yml:." --add-data "assets/images/error_page.jpg:assets/images/" --add-data "assets/utils/ascii_banner.txt:assets/utils/" --add-data "LICENSE:." --collect-data grapheme "main.py"
- name: Change permissions
if: runner.os == 'Linux' || runner.os == 'macOS'
run: chmod +x dist/VNULIB-Downloader-*
- name: Upload to artifact
uses: actions/upload-artifact@main
with:
name: VNULIB-Downloader-${{ env.OS_LOWER }}
path: dist/VNULIB-Downloader-*
compression-level: 6
retention-days: 30
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
needs:
- prepare
- build
if: ${{ needs.prepare.outputs.CONTINUE == 'true' }}
steps:
- name: Download Artifact
uses: actions/download-artifact@main
- name: Upload to Release
uses: svenstaro/upload-release-action@master
with:
body: ${{ needs.prepare.outputs.LAST_COMMIT }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./VNULIB-Downloader-*/VNULIB-Downloader-*
release_name: VNULIB Downloader ${{ needs.prepare.outputs.VERSION }}
tag: ${{ needs.prepare.outputs.VERSION }}
file_glob: true
overwrite: false
prerelease: ${{ needs.prepare.outputs.SET_PRE_RELEASE }}