Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 26 additions & 17 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
test:
# When running with act (https://github.com/nektos/act), these lines need to be appended with the ACT variable
# to force each job to run
if: github.repository == 'adobe/buildrunner' #|| ${{ env.ACT }}
if: github.repository == 'adobe/buildrunner' && (github.ref != 'refs/heads/main' || (github.ref == 'refs/heads/main' && github.event.pull_request.merged != true)) #|| ${{ env.ACT }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -49,10 +49,12 @@ jobs:
check_name: "Test Results ${{ matrix.python-version }}"
github_retries: 10
secondary_rate_limit_wait_seconds: 60.0
tag-commit:
if: github.repository == 'adobe/buildrunner' && github.event_name == 'push' && github.ref == 'refs/heads/main'
get-version:
if: github.repository == 'adobe/buildrunner'
runs-on: ubuntu-latest
needs: test
outputs:
current-version: ${{ steps.version-number.outputs.CURRENT_VERSION }}
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -64,12 +66,22 @@ jobs:
pip install -r requirements.txt
- name: Write version file
run: python scripts/write-version.py
- name: Get and set version in env
run: echo "CURRENT_VERSION=$( python -c 'from buildrunner.version import __version__; print(__version__)' )" >> $GITHUB_ENV
- name: Get current version
id: version-number
run: echo "CURRENT_VERSION=$( python -c 'from buildrunner.version import __version__; print(__version__)' )" >> $GITHUB_OUTPUT
- name: Print current version
run: echo CURRENT_VERSION ${{ env.CURRENT_VERSION }}
run: echo CURRENT_VERSION ${{ steps.version-number.outputs.CURRENT_VERSION }}
tag-commit:
if: github.repository == 'adobe/buildrunner' && github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: [test, get-version]
steps:
- uses: actions/checkout@v2
with:
# Fetch all history instead of the latest commit
fetch-depth: 0
- name: Tag commit
run: git tag ${{ env.CURRENT_VERSION }} && git push --tags
run: git tag ${{ needs.get-version.outputs.current-version }} && git push --tags
publish-pypi:
if: github.repository == 'adobe/buildrunner'
runs-on: ubuntu-latest
Expand All @@ -83,11 +95,14 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install wheel build
- name: Remove version file
# This is just in case something else created it, destroy it to get a fresh version
run: rm -f buildrunner/version.py
- name: Install wheel
run: pip install wheel build
- name: Write version file
run: python scripts/write-version.py
- name: Build
Expand All @@ -104,26 +119,20 @@ jobs:
publish-docker:
if: github.repository == 'adobe/buildrunner'
runs-on: ubuntu-latest
needs: test
needs: [test, get-version]
steps:
- uses: actions/checkout@v2
with:
# Fetch all history instead of the latest commit
fetch-depth: 0
- name: Write version file
run: python scripts/write-version.py
- name: Get and set version in env
run: echo "CURRENT_VERSION=$( python -c 'from buildrunner.version import __version__; print(__version__)' )" >> $GITHUB_ENV
- name: Print current version
run: echo CURRENT_VERSION ${{ env.CURRENT_VERSION }}
- name: Docker Tags
id: docker_tags
uses: docker/metadata-action@v3
with:
images: ghcr.io/adobe/buildrunner
tags: |
latest
${{ env.CURRENT_VERSION }}
${{ needs.get-version.outputs.current-version }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
Expand Down
Loading