Release v1.5.1 #64
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This Source Code Form is subject to the terms of the Mozilla Public | |
# License, v. 2.0. If a copy of the MPL was not distributed with this | |
# file, You can obtain one at https://mozilla.org/MPL/2.0/. | |
name: Publish release | |
on: | |
release: | |
types: [ published ] | |
workflow_dispatch: | |
jobs: | |
get_semver: | |
name: Get Semantic Version | |
runs-on: ubuntu-latest | |
outputs: | |
semver: ${{ steps.get.outputs.semver }} | |
steps: | |
- id: get | |
env: | |
RELEASE_VERSION: ${{ github.ref_name }} | |
run: | | |
# If ref name does not match semver, default to 0.0.0. | |
# This happens when running from a branch such as main. | |
if [[ "${RELEASE_VERSION}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+ ]]; then | |
echo "semver=${RELEASE_VERSION/v/}" >> "$GITHUB_OUTPUT" | |
else | |
echo "semver=0.0.0" >> "$GITHUB_OUTPUT" | |
fi | |
# Note: When modifying this job, copy modifications to all other workflows' image jobs. | |
all_component_images: | |
needs: get_semver | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- name: coturn | |
source_directory: addons/coturn | |
- name: coturn-web | |
source_directory: addons/coturn-web | |
- name: gst-web | |
source_directory: addons/gst-web | |
- name: gstreamer | |
version_suffix: -ubuntu20.04 | |
build_args: UBUNTU_RELEASE=20.04 | |
source_directory: addons/gstreamer | |
- name: gstreamer | |
version_suffix: -ubuntu22.04 | |
build_args: UBUNTU_RELEASE=22.04 | |
source_directory: addons/gstreamer | |
- name: js-interposer | |
version_suffix: -ubuntu20.04 | |
build_args: DISTRIB_RELEASE=20.04;PKG_NAME=selkies-js-interposer;PKG_VERSION=${{ needs.get_semver.outputs.semver }} | |
source_directory: addons/js-interposer | |
dockerfile: Dockerfile.ubuntu_debpkg | |
- name: js-interposer | |
version_suffix: -ubuntu22.04 | |
build_args: DISTRIB_RELEASE=22.04;PKG_NAME=selkies-js-interposer;PKG_VERSION=${{ needs.get_semver.outputs.semver }} | |
source_directory: addons/js-interposer | |
dockerfile: Dockerfile.ubuntu_debpkg | |
- name: infra-gcp-installer | |
source_directory: infra/gce/installer-image | |
- name: py-build | |
build_args: PACKAGE_VERSION=${{ needs.get_semver.outputs.semver }} | |
source_directory: . | |
name: ${{ matrix.name }}${{ matrix.version_suffix }} image build & publish | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build & publish ${{ matrix.name }} image | |
uses: ./.github/actions/build_and_publish_image | |
with: | |
build_args: ${{ matrix.build_args }} | |
github_personal_access_token: ${{ secrets.GITHUB_TOKEN }} | |
github_username: $GITHUB_ACTOR | |
image_name: ${{ matrix.name }} | |
image_source_directory: ${{ matrix.source_directory }} | |
image_version_1: $GITHUB_REF_NAME${{ matrix.version_suffix }} | |
image_version_2: latest${{ matrix.version_suffix }} | |
dockerfile: ${{ matrix.dockerfile || 'Dockerfile' }} | |
# Note: When modifying this job, copy modifications to all other workflows' image jobs. | |
all_example_images: | |
needs: | |
- get_semver | |
- all_component_images | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- name: gst-py-example | |
version_suffix: -ubuntu20.04 | |
build_args: PACKAGE_VERSION=${{ needs.get_semver.outputs.semver }};UBUNTU_RELEASE=20.04;GSTREAMER_BASE_IMAGE_RELEASE=$GITHUB_REF_NAME;PY_BUILD_IMAGE=ghcr.io/selkies-project/selkies-gstreamer/py-build:$GITHUB_REF_NAME;WEB_IMAGE=ghcr.io/selkies-project/selkies-gstreamer/gst-web:$GITHUB_REF_NAME;JS_BASE_IMAGE_RELEASE=$GITHUB_REF_NAME;JS_BASE_IMAGE=ghcr.io/selkies-project/selkies-gstreamer/js-interposer | |
dockerfile: Dockerfile.example | |
source_directory: . | |
- name: gst-py-example | |
version_suffix: -ubuntu22.04 | |
build_args: PACKAGE_VERSION=${{ needs.get_semver.outputs.semver }};UBUNTU_RELEASE=22.04;GSTREAMER_BASE_IMAGE_RELEASE=$GITHUB_REF_NAME;PY_BUILD_IMAGE=ghcr.io/selkies-project/selkies-gstreamer/py-build:$GITHUB_REF_NAME;WEB_IMAGE=ghcr.io/selkies-project/selkies-gstreamer/gst-web:$GITHUB_REF_NAME;JS_BASE_IMAGE_RELEASE=$GITHUB_REF_NAME;JS_BASE_IMAGE=ghcr.io/selkies-project/selkies-gstreamer/js-interposer | |
dockerfile: Dockerfile.example | |
source_directory: . | |
name: ${{ matrix.name }}${{ matrix.version_suffix }} image build & publish | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build & publish ${{ matrix.name }} image | |
uses: ./.github/actions/build_and_publish_image | |
with: | |
build_args: ${{ matrix.build_args }} | |
dockerfile: ${{ matrix.dockerfile }} | |
github_personal_access_token: ${{ secrets.GITHUB_TOKEN }} | |
github_username: $GITHUB_ACTOR | |
image_name: ${{ matrix.name }} | |
image_source_directory: ${{ matrix.source_directory }} | |
image_version_1: $GITHUB_REF_NAME${{ matrix.version_suffix }} | |
image_version_2: latest${{ matrix.version_suffix }} | |
all_assets: | |
needs: | |
- get_semver | |
- all_component_images | |
- all_example_images | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- id: gst20 | |
description: Ubuntu 20.04 | |
image_tag: ghcr.io/selkies-project/selkies-gstreamer/gstreamer:${{ github.ref_name }}-ubuntu20.04 | |
mimetype: application/tar+gzip | |
source_path: /opt/selkies-gstreamer-latest.tgz | |
target_directory: /tmp | |
target_name: selkies-gstreamer-${{ github.ref_name }}-ubuntu20.04.tgz | |
- id: gst22 | |
description: Ubuntu 22.04 | |
image_tag: ghcr.io/selkies-project/selkies-gstreamer/gstreamer:${{ github.ref_name }}-ubuntu22.04 | |
mimetype: application/tar+gzip | |
source_path: /opt/selkies-gstreamer-latest.tgz | |
target_directory: /tmp | |
target_name: selkies-gstreamer-${{ github.ref_name }}-ubuntu22.04.tgz | |
- id: js20 | |
description: JS Interposer Ubuntu 20.04 | |
image_tag: ghcr.io/selkies-project/selkies-gstreamer/js-interposer:${{ github.ref_name }}-ubuntu20.04 | |
mimetype: application/vnd.debian.binary-package | |
source_path: /opt/selkies-js-interposer_${{ needs.get_semver.outputs.semver }}.deb | |
target_directory: /tmp | |
target_name: selkies-js-interposer-${{ github.ref_name }}-ubuntu20.04.deb | |
- id: js22 | |
description: JS Interposer Ubuntu 22.04 | |
image_tag: ghcr.io/selkies-project/selkies-gstreamer/js-interposer:${{ github.ref_name }}-ubuntu22.04 | |
mimetype: application/vnd.debian.binary-package | |
source_path: /opt/selkies-js-interposer_${{ needs.get_semver.outputs.semver }}.deb | |
target_directory: /tmp | |
target_name: selkies-js-interposer-${{ github.ref_name }}-ubuntu22.04.deb | |
- id: py | |
description: Python | |
image_tag: ghcr.io/selkies-project/selkies-gstreamer/py-build:${{ github.ref_name }} | |
mimetype: application/x-pywheel+zip | |
source_path: /opt/pypi/dist/selkies_gstreamer-${{ needs.get_semver.outputs.semver }}-py3-none-any.whl | |
target_directory: /tmp | |
target_name: selkies_gstreamer-${{ needs.get_semver.outputs.semver }}-py3-none-any.whl | |
- id: web | |
description: Web | |
image_tag: ghcr.io/selkies-project/selkies-gstreamer/gst-web:${{ github.ref_name }} | |
mimetype: application/tar+gzip | |
source_path: /opt/gst-web.tgz | |
target_directory: /tmp | |
target_name: selkies-gstreamer-web-${{ github.ref_name }}.tgz | |
name: ${{ matrix.description }} release artifact extraction & upload | |
steps: | |
- name: ${{ matrix.description }} release artifact extraction | |
id: extract | |
run: | | |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin | |
docker create --name copy "${{ matrix.image_tag }}" | |
TARGET_PATH="${{ matrix.target_directory }}/${{ matrix.target_name }}" | |
docker cp "copy:${{ matrix.source_path }}" "$TARGET_PATH" | |
if [[ -d "$TARGET_PATH" ]]; then | |
SOURCE_DIRNAME=$(echo "${{ matrix.source_path }}" | sed 's:.*/::') | |
cd "${{ matrix.target_directory }}" && mv -f "$TARGET_PATH" "$SOURCE_DIRNAME" | |
tar -zcvf "temp.tgz" "$SOURCE_DIRNAME" && rm -rf "$SOURCE_DIRNAME" && mv -f "temp.tgz" "$TARGET_PATH" | |
fi | |
docker rm copy | |
- name: ${{ matrix.description }} release artifact upload | |
id: release | |
if: ${{ github.event_name == 'release' }} | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ github.ref }} | |
file: ${{ matrix.target_directory }}/${{ matrix.target_name }} | |
asset_name: ${{ matrix.target_name }} | |
overwrite: true | |
# Set release to latest manually when ready | |
make_latest: false |