diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 49de4e3..2c2aa0b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,17 +7,16 @@ on: jobs: - prod: - name: Release version + wait: + name: Wait for tests runs-on: ubuntu-latest steps: - - name: Wait for tests - uses: fountainhead/action-wait-for-check@v1.0.0 + - uses: fountainhead/action-wait-for-check@v1.0.0 id: wait-for-tests with: token: ${{ secrets.GITHUB_TOKEN }} - checkName: Run tests + checkName: Tests done ref: ${{ github.ref }} timeoutSeconds: 3600 @@ -25,6 +24,15 @@ jobs: uses: cutenode/action-always-fail@v1 if: steps.wait-for-tests.outputs.conclusion != 'success' + build: + name: Build package + runs-on: ubuntu-latest + needs: [wait] + strategy: + matrix: + python-version: ['2.7', '3.6'] + + steps: - name: Checkout code uses: actions/checkout@v2 @@ -33,6 +41,8 @@ jobs: - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} - name: Cache pip uses: actions/cache@v2 @@ -48,15 +58,28 @@ jobs: - name: Upgrade pip run: python -m pip install --upgrade pip setuptools wheel twine - - name: Download artifacts - uses: dawidd6/action-download-artifact@v2 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - workflow: test.yml - workflow_conclusion: success - name: dist - path: ./dist/ + - name: Install dependencies + run: pip install -r requirements.txt + + - name: Build package + run: python setup.py bdist_wheel sdist + + - name: Check package + run: twine check dist/* + + - name: Publish package + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + twine upload --skip-existing dist/* + + release: + name: Release version + runs-on: ubuntu-latest + needs: [wait, build] + steps: - name: Create release id: create_release uses: actions/create-release@v1 @@ -66,12 +89,4 @@ jobs: tag_name: ${{ github.ref }} release_name: ${{ github.ref }} draft: false - prerelease: false - - - name: Build and publish - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - TWINE_REPOSITORY_URL: dolfinus/setuptools-git-versioning - run: | - twine upload dist/* \ No newline at end of file + prerelease: false \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7f9513e..f9f3d32 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -55,8 +55,11 @@ jobs: - name: Build package run: python setup.py bdist_wheel sdist - - name: Push build artifacts - uses: actions/upload-artifact@v2 - with: - name: dist - path: dist/* + all_done: + name: Tests done + runs-on: ubuntu-latest + needs: [tests] + + steps: + - name: All done + run: echo 1