Release 7.0.0 #93
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
run-name: Release ${{ github.event.inputs.version }} | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: Version to be released | |
required: true | |
commit: | |
description: Commit to be released | |
required: false | |
defaults: | |
run: | |
shell: bash | |
concurrency: | |
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}' | |
cancel-in-progress: true | |
env: | |
VERSION: "${{ github.event.inputs.version }}" | |
COMMIT: "${{ github.event.inputs.commit }}" | |
jobs: | |
test: | |
name: Tests | |
environment: staging | |
runs-on: ubuntu-latest | |
steps: | |
- name: Print Input | |
run: | | |
echo "VERSION" | |
echo "${{ env.VERSION }}" | |
echo "COMMIT" | |
echo "${{ env.COMMIT }}" | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ env.COMMIT }} | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- name: Setup Project | |
run: | | |
python -m pip install --upgrade pip | |
pip install flake8 | |
pip install -r requirements.txt | |
- name: Lint | |
run: | | |
# stop the build if there are Python syntax errors or undefined names | |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
- name: Test | |
run: | | |
./run_tests.sh | |
build-ubuntu: | |
name: Ubuntu Release | |
environment: staging | |
runs-on: ubuntu-latest | |
needs: test | |
env: | |
PACKAGE_NAME: "logsmith_linux_${VERSION}.zip" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ env.COMMIT }} | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- name: Setup Project | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Build Project | |
run: | | |
python -m PyInstaller ./logsmith.spec | |
zip -r "${{ env.PACKAGE_NAME }}" ./dist/logsmith | |
- name: Release | |
run: | | |
if [ "${{ env.COMMIT }}" != "" ]; then | |
commit=${{ env.COMMIT }} | |
else | |
commit=${GITHUB_SHA} | |
fi | |
pip install requests | |
./ci/release.py \ | |
--repository "${{ github.repository }}" \ | |
--version "${{ env.VERSION }}" \ | |
--commit "${commit}" \ | |
--token "${{ secrets.GITHUB_TOKEN }}" \ | |
--asset "${{ env.PACKAGE_NAME }}" | |
build-darwin: | |
name: Darwin Release | |
environment: staging | |
runs-on: macos-latest | |
needs: test | |
env: | |
PACKAGE_NAME: "logsmith_darwin_${VERSION}.zip" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ env.COMMIT }} | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- name: Setup Project | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Build Project | |
run: | | |
python -m PyInstaller ./logsmith.spec | |
zip -r "${{ env.PACKAGE_NAME }}" ./dist/logsmith.app | |
- name: Release | |
run: | | |
if [ "${{ env.COMMIT }}" != "" ]; then | |
commit=${{ env.COMMIT }} | |
else | |
commit=${GITHUB_SHA} | |
fi | |
pip install requests | |
./ci/release.py \ | |
--repository "${{ github.repository }}" \ | |
--version "${{ env.VERSION }}" \ | |
--commit "${commit}" \ | |
--token "${{ secrets.GITHUB_TOKEN }}" \ | |
--asset "${{ env.PACKAGE_NAME }}" |