7279b3c207
Build / Build source distribution (push) Failing after 13s
Build / Execute unit tests (push) Failing after 8s
Build / Verify generated game data is current (push) Failing after 7s
Build / Upload Release Asset (push) Has been skipped
Build / upload_pypi (push) Has been skipped
106 lines
3.6 KiB
YAML
106 lines
3.6 KiB
YAML
name: Build
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
build_sdist:
|
|
name: Build source distribution
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-python@v2
|
|
name: Install Python
|
|
with:
|
|
python-version: '3.7'
|
|
- name: Build sdist
|
|
run: python setup.py sdist
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
with:
|
|
path: dist/*.tar.gz
|
|
test:
|
|
name: Execute unit tests
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-python@v2
|
|
name: Install Python
|
|
with:
|
|
python-version: '3.7'
|
|
|
|
- name: Install required packages
|
|
run: |
|
|
python -m pip install --upgrade tox
|
|
- name: Run unit tests
|
|
run: python -m tox -e ut
|
|
gamedata:
|
|
name: Verify generated game data is current
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-python@v2
|
|
name: Install Python
|
|
with:
|
|
python-version: '3.7'
|
|
|
|
# The tables under src/static are generated from the game data dumps.
|
|
# They are committed, so this job fails if someone edits them by hand or
|
|
# if upstream game data moved on and nobody regenerated them.
|
|
- name: Check committed tables match the dumps
|
|
run: make gamedata-check
|
|
upload_pypi:
|
|
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
|
|
needs: [build_sdist]
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/download-artifact@v2
|
|
with:
|
|
name: artifact
|
|
path: dist
|
|
|
|
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
with:
|
|
user: __token__
|
|
password: ${{ secrets.pypi_password }}
|
|
upload_release:
|
|
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
|
|
name: Upload Release Asset
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
- name: Create Release
|
|
id: create_release
|
|
uses: actions/create-release@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
tag_name: ${{ github.ref }}
|
|
release_name: Release ${{ github.ref }}
|
|
draft: false
|
|
prerelease: false
|
|
- name: Upload Windows Launcher
|
|
id: upload-windows-assets
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
|
|
asset_path: ./launchers/albion-online-stats.bat
|
|
asset_name: albion-online-stats.bat
|
|
asset_content_type: application/bat
|
|
- name: Upload Nix Launcher
|
|
id: upload-nix-assets
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
|
|
asset_path: ./launchers/albion-online-stats.sh
|
|
asset_name: albion-online-stats.sh
|
|
asset_content_type: text/x-shellscript
|