Skip to content

Commit

Permalink
RHOAIENG-15020: Add a dry mode option to the Release workflow (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulovmr authored Oct 30, 2024
1 parent 4a9679c commit 51a2e49
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
name: Elyra Build and Release
name: Elyra Release - Build
on:
push:
tags:
- v*
workflow_dispatch:
workflow_call:
inputs:
dry_run:
type: boolean
required: true
base_ref:
type: string
required: true

env:
FORCE_COLOR: true
Expand All @@ -37,6 +41,7 @@ jobs:
- name: Check out the repository
uses: actions/checkout@v4
with:
ref: ${{ inputs.base_ref }}
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
Expand All @@ -52,6 +57,7 @@ jobs:
yarn set version ${{ env.YARN_VERSION }}
yarn --version
- name: Check version
if: ${{ !inputs.dry_run && github.repository_owner == 'opendatahub-io' }}
run: |
set -o pipefail
LATEST_TAG=$(git describe --tags --match="v*")
Expand All @@ -64,6 +70,7 @@ jobs:
run: |
make install-prod
- name: Publish package on PyPI
if: ${{ !inputs.dry_run && github.repository_owner == 'opendatahub-io' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/release_dry_run.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#
# Copyright 2018-2023 Elyra Authors
#
# 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: Elyra Release - Dry Run
on:
workflow_dispatch:
inputs:
tag:
type: string
required: true
description: "Tag or branch associated with the release"
default: "main"
schedule:
- cron: "0 4 * * *" # 4am UTC everyday
pull_request:
branches: ["**"]
paths:
- ".github/workflows/release*"

concurrency:
group: ${{ github.event.pull_request && format('release-dry-run-pr-{0}', github.event.pull_request.number) || format('release-dry-run-ref-{0}', github.ref_name) }}
cancel-in-progress: true

jobs:
dry_run:
uses: ./.github/workflows/release_build.yml
with:
dry_run: true
base_ref: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref }}
33 changes: 33 additions & 0 deletions .github/workflows/release_publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#
# Copyright 2018-2023 Elyra Authors
#
# 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: Elyra Release - Publish
on:
push:
tags:
- v*
workflow_dispatch:
inputs:
tag:
type: string
required: true
description: "Tag associated with the release (e.g.: v4.0.0)"

jobs:
release:
uses: ./.github/workflows/release_build.yml
with:
dry_run: false
base_ref: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref }}

0 comments on commit 51a2e49

Please sign in to comment.