mirror of
https://github.com/ChristianLight/tutor.git
synced 2024-11-19 19:45:25 +00:00
6af6390fb1
GitHub Actions now performs the following tasks: - run tests on every PR - sync with git.overhang.io on push - build binary releases on tags Travis.CI was completely removed from this repo.
71 lines
2.3 KiB
YAML
71 lines
2.3 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- '*'
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- os: ubuntu-latest
|
|
locale: C.UTF-8
|
|
- os: macos-10.15
|
|
locale: en_US.UTF-8
|
|
env:
|
|
LC_ALL: ${{ matrix.locale }}
|
|
LANG: ${{ matrix.locale }}
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: 3.6
|
|
- name: Upgrade pip
|
|
run: python -m pip install --upgrade pip setuptools==44.0.0
|
|
- name: Print info about the current python installation
|
|
run: make ci-info
|
|
- name: Install requirements
|
|
run: make bootstrap-dev-plugins
|
|
- name: Run tests
|
|
run: make tests
|
|
- name: Create bundle
|
|
run: make bundle
|
|
- name: Test bundle
|
|
run: make ci-test-bundle
|
|
- name: Get release description
|
|
id: release-description
|
|
# We must escape multi-line string, as per:
|
|
# https://medium.com/agorapulse-stories/how-to-work-with-multiline-string-variables-in-github-actions-23f56447d209
|
|
run: |
|
|
make release-description
|
|
cat release_description.md
|
|
description="$(cat release_description.md)"
|
|
description="${description//'%'/'%25'}"
|
|
description="${description//$'\n'/'%0A'}"
|
|
description="${description//$'\r'/'%0D'}"
|
|
echo "::set-output name=text::$description"
|
|
shell: bash
|
|
- name: Get release file name
|
|
id: release-file
|
|
run: echo "::set-output name=filename::tutor-$(uname -s)_$(uname -m)"
|
|
shell: bash
|
|
- name: Debug release variables
|
|
run: |
|
|
echo "Publish file '${{ steps.release-file.outputs.filename }}' to release ${{ github.ref }}"
|
|
echo "================"
|
|
echo "${{ steps.release-description.outputs.text }}"
|
|
- name: Upload bundle
|
|
# https://github.com/marketplace/actions/upload-files-to-a-github-release
|
|
uses: svenstaro/upload-release-action@v2
|
|
with:
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
file: ./dist/tutor
|
|
asset_name: "${{ steps.release-file.outputs.filename }}"
|
|
tag: ${{ github.ref }}
|
|
overwrite: true
|
|
body: "${{ steps.release-description.outputs.text }}"
|