Skip to content

Commit

Permalink
chore: phase out old workflow tags (#141)
Browse files Browse the repository at this point in the history
* chore: phase out old workflow tags

* fix: remove potentially dangerous defaults
  • Loading branch information
webbertakken authored Jan 22, 2022
1 parent c82b022 commit fb51544
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 43 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/new-ubuntu-base-image-requested.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ name: New Ubuntu Base Version ⛭

on:
repository_dispatch:
types: [new_base_image_requested, new_ubuntu_base_image_requested]
types:
- new_base_images_requested
- new_ubuntu_base_image_requested

# Further reading:
# https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#repository_dispatch
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/new-ubuntu-hub-image-requested.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ name: New Ubuntu Hub Version ⚙

on:
repository_dispatch:
types: [ new_hub_image_requested, new_ubuntu_hub_image_requested ]
types:
- new_hub_images_requested
- new_ubuntu_hub_image_requested

# Further reading:
# https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#repository_dispatch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: New Ubuntu Editor Version 🗔

on:
repository_dispatch:
types: [ new_legacy_editor_image_requested, new_ubuntu_legacy_editor_image_requested ]
types:
- new_ubuntu_legacy_editor_image_requested

# Further reading:
# https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#repository_dispatch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: New Ubuntu Editor Version 🗔

on:
repository_dispatch:
types: [ new_2019_3_plus_editor_image_requested, new_ubuntu_post_2019_2_editor_image_requested ]
types:
- new_ubuntu_post_2019_2_editor_image_requested

# Further reading:
# https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#repository_dispatch
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/new-windows-base-image-requested.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,24 @@ name: New Windows Base Version ⛭

on:
repository_dispatch:
types: [new_windows_base_image_requested]
types:
- new_base_images_requested
- new_windows_base_image_requested
workflow_dispatch:
inputs:
jobId:
description: 'Job ID'
required: true
default: 'dryRun'
repoVersionFull:
description: 'Docker Repo Version Full'
description: 'All digits of the latest tag of this repository, e.g. `1.23.45`'
required: true
default: '0.15'
repoVersionMinor:
description: 'Docker Repo Version Minor'
description: 'Minor digit of that tag, e.g. `23`'
required: true
default: '15'
repoVersionMajor:
description: 'Docker Repo Version Major'
description: 'Major digit of that tag, e.g. `1`'
required: true
default: '0'

# Further reading:
# https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#repository_dispatch
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/new-windows-hub-image-requested.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,24 @@ name: New Windows Hub Version ⚙

on:
repository_dispatch:
types: [ new_windows_hub_image_requested ]
types:
- new_hub_images_requested
- new_windows_hub_image_requested
workflow_dispatch:
inputs:
jobId:
description: 'Job ID'
required: true
default: 'dryRun'
repoVersionFull:
description: 'Docker Repo Version Full'
description: 'All digits of the latest tag of this repository, e.g. `1.23.45`'
required: true
default: '0.15'
repoVersionMinor:
description: 'Docker Repo Version Minor'
description: 'Minor digit of that tag, e.g. `23`'
required: true
default: '15'
repoVersionMajor:
description: 'Docker Repo Version Major'
description: 'Major digit of that tag, e.g. `1`'
required: true
default: '0'

# Further reading:
# https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#repository_dispatch
Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/new-windows-legacy-editor-image-requested.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: New Windows Editor Version 🗔

on:
repository_dispatch:
types: [ new_windows_legacy_editor_image_requested ]
types:
- new_windows_legacy_editor_image_requested
workflow_dispatch:
inputs:
jobId:
Expand All @@ -18,17 +19,14 @@ on:
required: true
default: '79c78de19888'
repoVersionFull:
description: 'Docker Repo Version Full'
description: 'All digits of the latest tag of this repository, e.g. `1.23.45`'
required: true
default: '0.15'
repoVersionMinor:
description: 'Docker Repo Version Minor'
description: 'Minor digit of that tag, e.g. `23`'
required: true
default: '15'
repoVersionMajor:
description: 'Docker Repo Version Major'
description: 'Major digit of that tag, e.g. `1`'
required: true
default: '0'

# Further reading:
# https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#repository_dispatch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: New Windows Editor Version 🗔

on:
repository_dispatch:
types: [ new_windows_post_2019_2_editor_image_requested ]
types:
- new_windows_post_2019_2_editor_image_requested
workflow_dispatch:
inputs:
jobId:
Expand All @@ -18,17 +19,14 @@ on:
required: true
default: '79c78de19888'
repoVersionFull:
description: 'Docker Repo Version Full'
description: 'All digits of the latest tag of this repository, e.g. `1.23.45`'
required: true
default: '0.15'
repoVersionMinor:
description: 'Docker Repo Version Minor'
description: 'Minor digit of that tag, e.g. `23`'
required: true
default: '15'
repoVersionMajor:
description: 'Docker Repo Version Major'
description: 'Major digit of that tag, e.g. `1`'
required: true
default: '0'

# Further reading:
# https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#repository_dispatch
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/retry-ubuntu-editor-image-requested.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: Retry Building Ubuntu Editor Version 🗔

on:
repository_dispatch:
types: [ retry_editor_image_requested, retry_ubuntu_editor_image_requested ]
types:
- retry_ubuntu_editor_image_requested

# Further reading:
# https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#repository_dispatch
Expand Down
21 changes: 11 additions & 10 deletions .github/workflows/retry-windows-editor-image-requested.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: Retry Building Windows Editor Version 🗔

on:
repository_dispatch:
types: [ retry_windows_editor_image_requested ]
types:
- retry_windows_editor_image_requested

# Further reading:
# https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#repository_dispatch
Expand All @@ -16,7 +17,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2

#################
# Variables #
#################
Expand All @@ -30,7 +31,7 @@ jobs:
echo "repoVersion (full): ${{ github.event.client_payload.repoVersionFull }}"
echo "repoVersion (only minor and major): ${{ github.event.client_payload.repoVersionMinor }}"
echo "repoVersion (only major): ${{ github.event.client_payload.repoVersionMajor }}"
- name: Report new build
uses: ./.github/workflows/actions/report-to-backend
with:
Expand All @@ -43,7 +44,7 @@ jobs:
repoVersion: ${{ github.event.client_payload.repoVersionFull }}
editorVersion: ${{ github.event.client_payload.editorVersion }}
targetPlatform: ${{ github.event.client_payload.targetPlatform }}

#############
# Setup #
#############
Expand All @@ -52,7 +53,7 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
run: docker login --username $Env:username --password $Env:password

- name: Check if image not already exists
run: |
# Source: https://stackoverflow.com/a/39731444/3593896
Expand All @@ -71,7 +72,7 @@ jobs:
echo "Image already exists. Exiting."
exit 1
}
#######################
# Free disk space #
#######################
Expand Down Expand Up @@ -104,7 +105,7 @@ jobs:
--push
### Warning: If we once publish latest, we will have to do it forever. Lets not do that unless it's needed ###
### Another warning: order is important: We go from specific to unspecific with the exception of the most specific tag which is used to check if the image is already there ###
#######################
# Retry the above #
#######################
Expand All @@ -130,7 +131,7 @@ jobs:
- name: Inspect
run: |
docker buildx imagetools inspect unityci/editor:windows-${{ github.event.client_payload.editorVersion }}-${{ github.event.client_payload.targetPlatform }}-${{ github.event.client_payload.repoVersionFull }}
- name: Image digest
id: image-digest
if: ${{ success() }}
Expand Down Expand Up @@ -160,7 +161,7 @@ jobs:
friendlyTag: windows-${{ github.event.client_payload.repoVersionMinor }}
specificTag: windows-${{ github.event.client_payload.repoVersionFull }}
digest: ${{ steps.image-digest.outputs.digest }}

- name: Report failure
if: ${{ failure() || cancelled() }}
uses: ./.github/workflows/actions/report-to-backend
Expand All @@ -176,7 +177,7 @@ jobs:
targetPlatform: ${{ github.event.client_payload.targetPlatform }}
# Failure info
reason: ${{ job.status }}

###############
# Metrics #
###############
Expand Down

0 comments on commit fb51544

Please sign in to comment.