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

Gh-332: Update actions versions #333

Merged
merged 5 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
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
19 changes: 18 additions & 1 deletion .github/release-notes.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,26 @@
# Copyright 2020-2023 Crown Copyright
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

releasenotes:
sections:
- title: "Headliners"
emoji: ":star:"
labels: [ "headliner" ]
- title: "New Features"
emoji: ":gift:"
labels: [ "feature" ]
- title: "Enhancements"
emoji: ":sparkles:"
labels: [ "enhancement" ]
- title: "Bugs Fixed"
Expand All @@ -14,4 +31,4 @@ releasenotes:
labels: "documentation"
- title: "Automation"
emoji: ":robot:"
labels: [ "automation" ]
labels: [ "automation" ]
2 changes: 1 addition & 1 deletion .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
remove-android: 'true'
overprovision-lvm: 'true'

- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down
25 changes: 4 additions & 21 deletions .github/workflows/create-hotfix-branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:

steps:
- name: Checkout master
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: master
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
Expand All @@ -46,29 +46,12 @@ jobs:
if: ${{ !github.event.inputs.version }}
run: echo "CURRENT_VERSION=$(echo ${{ steps.get-latest-tag.outputs.tag }} | sed 's/^v//')" >> $GITHUB_ENV

- name: Bump latest tag variable
- name: Bump latest tag variable version
if: ${{ !github.event.inputs.version }}
uses: actions-ecosystem/action-bump-semver@v1
id: bump-semver
with:
current_version: ${{ env.CURRENT_VERSION }}
level: patch

- name: Set version automatically
if: ${{ !github.event.inputs.version }}
run: echo "RELEASE_VERSION=$(echo ${{ steps.bump-semver.outputs.new_version }} )" >> $GITHUB_ENV
run: echo "RELEASE_VERSION=$(echo ${{ env.CURRENT_VERSION }} | sed -r 's/([0-9]+)\.([0-9]+)\.([0-9]+)/echo \1.\2.$((\3+1))/' | sh)" >> $GITHUB_ENV

- name: Verify version regex
uses: actions-ecosystem/action-regex-match@v2
id: regex-match
with:
text: ${{ env.RELEASE_VERSION }}
# Ensure version doesn't end in .0
regex: '^(0|[1-9]\d*)\.(0|[1-9]\d*)\.([1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$'

- name: Fail if incorrect version
if: ${{ !steps.regex-match.outputs.match }}
run: exit 1
run: echo ${{ env.RELEASE_VERSION }} | grep -E '^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$'

- name: Set hotfix branch
run: echo "BRANCH_NAME=$(echo hotfix/${{ env.RELEASE_VERSION }} )" >> $GITHUB_ENV
Expand Down
25 changes: 4 additions & 21 deletions .github/workflows/create-release-branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:

steps:
- name: Checkout develop
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: develop
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
Expand All @@ -46,29 +46,12 @@ jobs:
if: ${{ !github.event.inputs.version }}
run: echo "CURRENT_VERSION=$(echo ${{ steps.get-latest-tag.outputs.tag }} | sed 's/^v//')" >> $GITHUB_ENV

- name: Bump latest tag variable
- name: Bump latest tag variable version
if: ${{ !github.event.inputs.version }}
uses: actions-ecosystem/action-bump-semver@v1
id: bump-semver
with:
current_version: ${{ env.CURRENT_VERSION }}
level: minor

- name: Set version automatically
if: ${{ !github.event.inputs.version }}
run: echo "RELEASE_VERSION=$(echo ${{ steps.bump-semver.outputs.new_version }} )" >> $GITHUB_ENV
run: echo "RELEASE_VERSION=$(echo ${{ env.CURRENT_VERSION }} | sed -r 's/([0-9]+)\.([0-9]+)\.([0-9]+)/echo \1.$((\2+1)).0/' | sh)" >> $GITHUB_ENV

- name: Verify version regex
uses: actions-ecosystem/action-regex-match@v2
id: regex-match
with:
text: ${{ env.RELEASE_VERSION }}
# Ensure valid semver version
regex: '^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$'

- name: Fail if incorrect version
if: ${{ !steps.regex-match.outputs.match }}
run: exit 1
run: echo ${{ env.RELEASE_VERSION }} | grep -E '^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$'

- name: Set release branch
run: echo "BRANCH_NAME=$(echo release/${{ env.RELEASE_VERSION }} )" >> $GITHUB_ENV
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
GAFFER_VERSION: develop
GAFFER_TESTER_VERSION: develop
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Run Integration Tests
run: |
Expand Down
16 changes: 15 additions & 1 deletion .github/workflows/link-issue.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# Copyright 2020-2023 Crown Copyright
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: 'Issue Links'
on:
pull_request:
Expand All @@ -7,7 +21,7 @@ jobs:
issue-links:
runs-on: ubuntu-latest
steps:
- uses: tkt-actions/add-issue-links@v1.6.0
- uses: tkt-actions/add-issue-links@v1.8.2
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
branch-prefix: 'gh-'
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:

steps:
- name: Checkout master
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: master
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
Expand All @@ -47,7 +47,7 @@ jobs:

- name: Output branch name
id: branch
run: echo "::set-output name=branch_name::$BRANCH_NAME"
run: echo "branch_name=$BRANCH_NAME" >> $GITHUB_OUTPUT

- name: Fail if no branch found
if: ${{ !env.BRANCH_NAME }}
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
- create-release-tag

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
Expand All @@ -101,7 +101,7 @@ jobs:
- update-branches

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: develop

Expand Down Expand Up @@ -129,7 +129,7 @@ jobs:
release_upload_url: ${{ steps.upload_notes.outputs.upload_url }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: develop

Expand Down Expand Up @@ -167,7 +167,7 @@ jobs:
- gaffer-jhub

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: develop

Expand Down Expand Up @@ -206,7 +206,7 @@ jobs:

steps:
- name: Checkout gh-pages
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: gh-pages
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
Expand Down