7
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-06-01 13:50:47 +00:00
tutor/.github/workflows/release.yml
2023-04-13 16:24:24 +02:00

73 lines
2.3 KiB
YAML

# This script can be tested locally with act:
#
# act --secret GITHUB_TOKEN=... --job release
#
# https://github.com/nektos/act/
# To generate a token: https://github.com/settings/tokens (add r/w permissions for "Contents")
name: Release
on:
push:
tags:
- '*'
jobs:
release:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
# https://github.com/actions/runner-images#available-images
# It's important that we build the tutor binaries with the *oldest* possible
# OS releases and Python version. See these docs for more information:
# https://pyinstaller.org/en/stable/usage.html#making-gnu-linux-apps-forward-compatible
- os: ubuntu-20.04
locale: C.UTF-8
gh_os: linux
# https://endoflife.date/macos
- os: macos-10.15
locale: en_US.UTF-8
gh_os: macOs
env:
LC_ALL: ${{ matrix.locale }}
LANG: ${{ matrix.locale }}
steps:
##### Setup environment
# https://github.com/actions/checkout
- uses: actions/checkout@v3
- name: Set up Python
# https://github.com/actions/setup-python
uses: actions/setup-python@v3
with:
python-version: 3.7
- name: Upgrade pip and setuptools
# https://pypi.org/project/pip/
# https://pypi.org/project/setuptools/
# https://pypi.org/project/wheel/
run: python -m pip install --upgrade pip setuptools==65.6.3 wheel
- name: Print info about the current python installation
run: make ci-info
- name: Install requirements
run: make bootstrap-dev-plugins
##### Run tests, generate bundle
- name: Run tests
run: make test
- name: Create bundle
run: make bundle
- name: Test bundle
run: make ci-test-bundle
##### Create release on GitHub
- name: Create or update GitHub release
run: scriv github-release
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Upload release asset to GitHub
run: |
export FILENAME="tutor-$(uname -s)_$(uname -m)"
mv ./dist/tutor $FILENAME
${{ env.gh_bin }} release upload --clobber ${{ github.ref_name }} $FILENAME
env:
GH_TOKEN: ${{ github.token }}