Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct conditional logic for publishing steps of build workflow #2261

Merged
merged 4 commits into from
Oct 19, 2023
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
56 changes: 23 additions & 33 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -284,27 +284,27 @@ jobs:

steps:
- name: Checkout
if: fromJSON(matrix.config.container).image == null
if: fromJSON(matrix.config.container) == null
uses: actions/checkout@v4

- name: Checkout
# actions/checkout@v4 has dependency on a higher version of glibc than available in the Linux container.
if: fromJSON(matrix.config.container).image != null
if: fromJSON(matrix.config.container) != null
uses: actions/checkout@v3

- name: Install Node.js
if: fromJSON(matrix.config.container).image == null
if: fromJSON(matrix.config.container) == null
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'

- name: Install Python 3.x
if: fromJSON(matrix.config.container).image == null
if: fromJSON(matrix.config.container) == null
uses: actions/setup-python@v4
with:
python-version: '3.x'
python-version: '3.11.x'

- name: Install Go
uses: actions/setup-go@v4
Expand Down Expand Up @@ -452,24 +452,6 @@ jobs:
name: ${{ env.JOB_TRANSFER_ARTIFACT }}
path: ${{ env.CHANNEL_FILES_PATH }}

# This job serves only as a container for the logic necessary to allow dependent jobs to run if the
# merge-channel-files job was skipped.
merge-channel-files-complete:
needs:
- merge-channel-files
if: >
always() &&
(
needs.merge-channel-files.result == 'skipped' ||
needs.merge-channel-files.result == 'success'
)
runs-on: ubuntu-latest
permissions: {}
steps:
# GitHub Actions requires every job to have >=1 step.
- name: Dummy step
run: ''

artifacts:
name: ${{ matrix.artifact.name }} artifact
needs:
Expand Down Expand Up @@ -546,9 +528,16 @@ jobs:
publish:
needs:
- build-type-determination
- merge-channel-files-complete
- merge-channel-files
- changelog
if: >
always() &&
needs.build-type-determination.result == 'success' &&
(
needs.merge-channel-files.result == 'skipped' ||
needs.merge-channel-files.result == 'success'
) &&
needs.changelog.result == 'success' &&
needs.build-type-determination.outputs.publish-to-s3 == 'true' &&
needs.build-type-determination.outputs.is-nightly == 'true'
runs-on: ubuntu-latest
Expand All @@ -572,9 +561,17 @@ jobs:
release:
needs:
- build-type-determination
- merge-channel-files-complete
- merge-channel-files
- changelog
if: needs.build-type-determination.outputs.is-release == 'true'
if: >
always() &&
needs.build-type-determination.result == 'success' &&
(
needs.merge-channel-files.result == 'skipped' ||
needs.merge-channel-files.result == 'success'
) &&
needs.changelog.result == 'success' &&
needs.build-type-determination.outputs.is-release == 'true'
runs-on: ubuntu-latest
steps:
- name: Download [GitHub Actions]
Expand All @@ -598,13 +595,6 @@ jobs:
file_glob: true
body: ${{ needs.changelog.outputs.BODY }}

# Temporary measure to prevent release update offers before the manually produced builds are uploaded.
# The step must be removed once fully automated builds are regained.
- name: Remove "channel update info files" related to manual builds
run: |
# See: https://github.com/arduino/arduino-ide/issues/2018
rm "${{ env.JOB_TRANSFER_ARTIFACT }}/stable-linux.yml"

- name: Publish Release [S3]
if: needs.build-type-determination.outputs.publish-to-s3 == 'true'
uses: docker://plugins/s3
Expand Down