auto build package
Closed this issue · 0 comments
soleil0-0 commented
Details
- use CI to build package
Travis CI
.travis.yml
language: python
jobs:
include:
# - name: "Python 3.7.4 on Xenial Linux"
# python: 3.7.4
# before_install:
# - sudo apt-get -y install libgtk-3-dev libglu1-mesa-dev
# - pip install -U -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-16.04 wxPython
# env:
# - DEPLOY_FILE=dist/gs_linux_amd64.zip
- name: "Python 3.7.4 on macOS"
os: osx
osx_image: xcode11.2 # Python 3.7.4 running on macOS 10.14.4
language: shell # 'language: python' is an error on Travis CI macOS
env:
- DEPLOY_FILE=dist/gs_darwin_amd64.zip
- name: "Python 3.7.4 on Windows"
os: windows # Windows 10.0.17134 N/A Build 17134
language: shell # 'language: python' is an error on Travis CI Windows
before_install:
- choco install python --version 3.7.4
env:
- PATH=/c/Python37:/c/Python37/Scripts:$PATH
- DEPLOY_FILE=dist/gs_windows_amd64.zip
install:
- python -m pip install -U pip
- pip install -U pipenv
- pipenv install --three --dev --skip-lock
- pipenv graph
script:
- |
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
pipenv run build_osx
elif [ "$TRAVIS_OS_NAME" = "linux" ]; then
#pipenv run build_linux
echo TODO
elif [ "$TRAVIS_OS_NAME" = "windows" ]; then
pipenv run build_win
fi
deploy:
provider: releases
api_key:
secure: "$GITHUB_TOKEN_SECURE"
file: "$DEPLOY_FILE"
skip_cleanup: true
draft: true
on:
tags: true
status badge
[![Build Status](https://travis-ci.org/soleil0-0/GazelleSync.svg?branch=master)](https://travis-ci.org/soleil0-0/GazelleSync)
Github Actions
.github/workflows/main.yml
name: Upload Release Asset
on:
push:
tags:
- "*"
pull_request
issues:
types: [opened]
jobs:
build_ubuntu:
name: Build Release Asset - Ubuntu
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.7.8"
- name: Install packages
run: sudo apt-get -y install libgtk-3-dev libglu1-mesa-dev
- name: Install dependencies
run: |
pip install -U pipenv
pipenv install --three --dev --skip-lock
- name: Build project
run: |
echo TODO
- uses: actions/upload-artifact@v2
with:
name: gs_linux_amd64.zip
path: dist/gs_linux_amd64.zip
build_macos:
name: Build Release Asset - MacOS
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.7.8"
- name: Install dependencies
run: |
pip install -U pipenv
pipenv install --three --dev --skip-lock
- name: Build project
run: pipenv run build_osx
- uses: actions/upload-artifact@v2
with:
name: gs_darwin_amd64.zip
path: dist/gs_darwin_amd64.zip
build_windows:
name: Build Release Asset - Windows
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.7.8"
- name: Install dependencies
run: |
pip install -U pipenv
pipenv install --three --dev --skip-lock
- name: Build project
run: |
pipenv run build_win
- uses: actions/upload-artifact@v2
with:
name: gs_windows_amd64.zip
path: dist/gs_windows_amd64.zip
Reference
- Travis CI: Running Python tests on multiple Operating Systems
- Github Actions
- cross platform
- new tag event
- act: GitHub Actions locally
- GitHub Actions Manual Trigger
- Upload multi assets from different os to a release
- own runner
- install python3-wxgtk on ubuntu