From 86da59c9f64ea70df16c1207b847d8fd4c27363a Mon Sep 17 00:00:00 2001 From: Alexander Dupuy <33216+dupuy@users.noreply.github.com> Date: Mon, 4 Mar 2024 10:12:25 -0500 Subject: [PATCH] feat: create python-app.yaml --- .github/workflows/python-app.yaml | 55 +++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/python-app.yaml diff --git a/.github/workflows/python-app.yaml b/.github/workflows/python-app.yaml new file mode 100644 index 0000000..bed663f --- /dev/null +++ b/.github/workflows/python-app.yaml @@ -0,0 +1,55 @@ +# This workflow will install Python dependencies and upload build artifacts to GitHub. +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + +name: 'Build and upload Python app' + +on: + push: + branches: ['main'] + pull_request: + branches: ['main'] + +# Declare default permissions as read only. +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: 'Checkout repository' + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + with: + depth: 20 + fetch-tags: true + + - name: 'Get tag-based commit name' + run: 'TAG=$(git describe --tags) && echo "commitTag=$TAG" >> $GITHUB_ENV' + + - name: 'Install Poetry' + run: 'pipx install poetry' + + - name: 'Set up Python' + id: setup-python + uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0 + with: + python-version: '>=3.9 <3.13' + cache: 'poetry' + + - name: 'Install dependencies' + run: 'poetry install reliabot[pyre2-wheels]' + + - name: 'Build distribution packages' + run: 'poetry build' + + - name: 'Upload distribution packages' + id: upload-artifact + uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 + with: + name: 'dist-reliabot-${{ env.commitTag }}-${{ steps.setup-python.outputs.python-version }}' + path: 'dist/' + if-no-files-found: error + overwrite: true + + # https://github.com/softprops/action-gh-release