From a084eb5c32f77658f436c35242d69e84f93de21e Mon Sep 17 00:00:00 2001 From: Arjan Molenaar Date: Wed, 12 Feb 2020 15:44:33 +0100 Subject: [PATCH] Combine build and release, so we can test all in one go --- .github/workflows/build.yml | 34 +++++++++++++++++++++++++++++++--- .github/workflows/release.yml | 35 ----------------------------------- 2 files changed, 31 insertions(+), 38 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3bd18c93eb..7b3e8688f2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,7 +31,7 @@ jobs: pip install flake8==3.7.9 flake8 gaphor - test-linux: + linux: needs: lint runs-on: ubuntu-latest strategy: @@ -68,7 +68,17 @@ jobs: CC_TEST_REPORTER_ID: 05f6288b94a87daa172d3e96a33ec331a4374be7d01eb9a42b3b21c4c550a8ff with: coverageCommand: coverage xml - test-windows: + - name: Build + run: | + make translate + poetry build + - name: Publish to PyPI + if: github.event_name == "release" + run: | + poetry publish -u __token__ -p ${{ secrets.PYPI_TOKEN }} + + + windows: needs: lint runs-on: windows-latest env: @@ -103,7 +113,9 @@ jobs: env: CHERE_INVOKING: yes PY_IGNORE_IMPORTMISMATCH: yes - test-macos: + + + macos: needs: lint runs-on: macOS-latest env: @@ -132,3 +144,19 @@ jobs: pip install pytest-xvfb - name: Test with Pytest run: pytest + - name: Create macOS Binary + run: | + poetry build + cd macos-dmg + ./package.sh + - name: Upload Assets + uses: actions/upload-artifact@v1 + with: + name: Gaphor.dmg + path: macos-dmg/*dmg + - name: Upload Assets to release + uses: AButler/upload-release-assets@v2.0 + if: github.event_name == "release" + with: + files: 'macos-dmg/*dmg;dist/*' + repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 984795a34e..341db1d926 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -43,38 +43,3 @@ jobs: with: files: 'win-installer/*.exe' repo-token: ${{ secrets.GITHUB_TOKEN }} - upload-macos: - runs-on: macOS-latest - env: - PKG_CONFIG_PATH: /usr/local/Cellar/libffi/3.2.1/lib/pkgconfig:${PKG_CONFIG_PATH:-} - steps: - - uses: actions/checkout@v1 - - name: Set up Python - uses: actions/setup-python@v1 - with: - python-version: 3.7 - - name: Install Dependencies - run: brew install gobject-introspection gtk+3 adwaita-icon-theme - - name: Install Poetry - uses: dschep/install-poetry-action@v1.3 - with: - version: 1.0.2 - - name: Use Python Dependency Cache - uses: actions/cache@v1.0.3 - with: - path: ~/Library/Caches/pip - key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }} - restore-keys: ${{ runner.os }}-poetry- - - name: Install Python Dependencies - run: poetry install - - name: Build Wheel and sdist - run: poetry build - - name: Create macOS Binary - run: | - cd macos-dmg - ./package.sh - - name: Upload Assets - uses: AButler/upload-release-assets@v2.0 - with: - files: 'macos-dmg/*dmg;dist/*' - repo-token: ${{ secrets.GITHUB_TOKEN }}