Skip to content

publish

publish #10

Workflow file for this run

#
# Copyright 2024 tosit.io
#
# 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: publish
on:
### Periodically rebuild all the images to fix os security vulnerabilities
schedule:
# At 05:00 AM, only on Tuesday
#- cron: "0 5 * * 2"
# https://crontab.cronhub.io/
# At 05:"0 AM, only on Tuesday
- cron: "0 5 * * 2"
# The release should be created manually (or with user token=pr approval/merge) in order to trigger the event
### https://github.com/orgs/community/discussions/25281
### Instead of using the event, we call the workflow from release-please workflow (more secure)
#release:
# types: [published]
workflow_dispatch:
# https://docs.github.com/en/actions/using-jobs/using-concurrency
concurrency:
# Only cancel in-progress jobs or runs for the current workflow - matches against branch & tags
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
packages: write
jobs:
latest-github-release:
if: github.repository_owner == 'OKDP'
runs-on: "ubuntu-latest"
outputs:
tag_name: ${{ steps.git-release-tag.outputs.tag_name }}
steps:
- name: Checkout Repo ⚡️
uses: actions/checkout@v4
- name: Get latest GitHub Release tag name 📥
id: git-release-tag
uses: InsonusK/get-latest-release@v1.0.1
with:
myToken: ${{ github.token }}
exclude_types: "draft"
view_top: 1
- name: Info - Found latest release tag
run: |
echo "id: ${{ steps.git-release-tag.outputs.id }}"
echo "name: ${{ steps.git-release-tag.outputs.name }}"
echo "tag_name: ${{ steps.git-release-tag.outputs.tag_name }}"
echo "created_at: ${{ steps.git-release-tag.outputs.created_at }}"
echo "draft: ${{ steps.git-release-tag.outputs.draft }}"
echo "prerelease: ${{ steps.git-release-tag.outputs.prerelease }}"
shell: bash
get-release-versions:
if: github.repository_owner == 'OKDP'
runs-on: "ubuntu-latest"
outputs:
matrix: ${{ steps.release-versions.outputs.matrix }}
steps:
- name: Checkout Repo ⚡️
uses: actions/checkout@v4
- name: Get release versions matrix 📥
id: release-versions
uses: ./.github/actions/spark-version-matrix
with:
use_matrix: ".build/release-versions.yml"
spark-publish:
if: github.repository_owner == 'OKDP' && needs.latest-github-release.outputs.tag_name != ''
name: spark-publish (${{ needs.latest-github-release.outputs.tag_name }}/spark-${{ matrix.version.spark_version }})
needs: [latest-github-release, get-release-versions]
strategy:
fail-fast: false
matrix:
version: ${{ fromJson(needs.get-release-versions.outputs.matrix) }}
uses: ./.github/workflows/build-images-template.yml
with:
python_version: ${{ matrix.version.python_version }}
spark_version: ${{ matrix.version.spark_version }}
java_version: ${{ matrix.version.java_version }}
scala_version: ${{ matrix.version.scala_version }}
hadoop_version: ${{ matrix.version.hadoop_version }}
registry: ${{ vars.REGISTRY || 'quay.io' }}
publish_to_registry: "true"
git_latest_release_tag: ${{ needs.latest-github-release.outputs.tag_name }}
secrets: inherit