Release v1.4.1 #49
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: [created, edited] | |
workflow_dispatch: | |
jobs: | |
get_semver: | |
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 name like master. | |
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: 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 }} | |
# 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 | |
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 | |
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: | |
- all_component_images | |
- get_semver | |
runs-on: ubuntu-latest | |
outputs: | |
gst20_cache_key: ${{ steps.extract.outputs.gst20_cache_key }} | |
gst20_mimetype: ${{ steps.extract.outputs.gst20_mimetype }} | |
gst20_name: ${{ steps.extract.outputs.gst20_name }} | |
gst20_path: ${{ steps.extract.outputs.gst20_path }} | |
gst22_cache_key: ${{ steps.extract.outputs.gst22_cache_key }} | |
gst22_mimetype: ${{ steps.extract.outputs.gst22_mimetype }} | |
gst22_name: ${{ steps.extract.outputs.gst22_name }} | |
gst22_path: ${{ steps.extract.outputs.gst22_path }} | |
py_cache_key: ${{ steps.extract.outputs.py_cache_key }} | |
py_mimetype: ${{ steps.extract.outputs.py_mimetype }} | |
py_name: ${{ steps.extract.outputs.py_name }} | |
py_path: ${{ steps.extract.outputs.py_path }} | |
web_cache_key: ${{ steps.extract.outputs.web_cache_key }} | |
web_mimetype: ${{ steps.extract.outputs.web_mimetype }} | |
web_name: ${{ steps.extract.outputs.web_name }} | |
web_path: ${{ steps.extract.outputs.web_path }} | |
strategy: | |
matrix: | |
include: | |
- id: gst20 | |
cache_key: gstreamer-asset-ubuntu2004 | |
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 | |
upload_bucket_path: gs://selkies-project-releases/selkies-gstreamer/${{ github.ref_name }}/ | |
- id: gst22 | |
cache_key: gstreamer-asset-ubuntu2204 | |
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 | |
upload_bucket_path: gs://selkies-project-releases/selkies-gstreamer/${{ github.ref_name }}/ | |
- id: py | |
cache_key: gst-py-asset | |
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 | |
upload_bucket_path: gs://selkies-project-releases/selkies-gstreamer/${{ github.ref_name }}/ | |
- id: web | |
cache_key: gst-web-asset | |
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 | |
upload_bucket_path: gs://selkies-project-releases/selkies-gstreamer/${{ github.ref_name }}/ | |
name: ${{ matrix.description }} asset extraction | |
steps: | |
- id: extract | |
run: | | |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
cat - > /tmp/sa_key.json <<EOF | |
${{ secrets.GCP_ACTIONS_SA_KEY }} | |
EOF | |
gcloud -q auth activate-service-account --key-file /tmp/sa_key.json | |
docker create --name copy ${{ matrix.image_tag }} | |
TARGET_PATH=${{ matrix.target_directory }}/${{ matrix.target_name }} | |
if [[ ${{ matrix.source_path }} == *\.whl || ${{ matrix.source_path }} == *\.tgz ]] | |
then | |
docker cp copy:${{ matrix.source_path }} $TARGET_PATH | |
else | |
( | |
cd ${{ matrix.target_directory }} && | |
docker cp copy:${{ matrix.source_path }} ./temp && | |
tar -zcvf $TARGET_PATH temp | |
) | |
fi | |
docker rm copy | |
gsutil cp $TARGET_PATH ${{ matrix.upload_bucket_path }} | |
echo ${{ matrix.id }}_cache_key=${{ matrix.cache_key }} >> $GITHUB_OUTPUT | |
echo ${{ matrix.id }}_mimetype=${{ matrix.mimetype }} >> $GITHUB_OUTPUT | |
echo ${{ matrix.id }}_name=${{ matrix.target_name }} >> $GITHUB_OUTPUT | |
echo ${{ matrix.id }}_path=$TARGET_PATH >> $GITHUB_OUTPUT | |
- uses: actions/cache@v3 | |
with: | |
key: ${{ matrix.cache_key }} | |
path: ${{ matrix.target_directory }}/${{ matrix.target_name }} | |
upload_assets: | |
runs-on: ubuntu-latest | |
if: github.event_name == 'release' | |
needs: | |
- all_component_images | |
- all_example_images | |
- all_assets | |
steps: | |
- name: Ubuntu 20.04 cache read | |
uses: actions/cache@v3 | |
with: | |
key: ${{ needs.all_assets.outputs.gst20_cache_key }} | |
path: ${{ needs.all_assets.outputs.gst20_path }} | |
- name: Ubuntu 22.04 cache read | |
uses: actions/cache@v3 | |
with: | |
key: ${{ needs.all_assets.outputs.gst22_cache_key }} | |
path: ${{ needs.all_assets.outputs.gst22_path }} | |
- name: Python cache read | |
uses: actions/cache@v3 | |
with: | |
key: ${{ needs.all_assets.outputs.py_cache_key }} | |
path: ${{ needs.all_assets.outputs.py_path }} | |
- name: Web cache read | |
uses: actions/cache@v3 | |
with: | |
key: ${{ needs.all_assets.outputs.web_cache_key }} | |
path: ${{ needs.all_assets.outputs.web_path }} | |
- name: Ubuntu 20.04 upload | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ github.ref }} | |
file: ${{ needs.all_assets.outputs.gst20_path }} | |
asset_name: ${{ needs.all_assets.outputs.gst20_name }} | |
overwrite: true | |
- name: Ubuntu 22.04 upload | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ github.ref }} | |
file: ${{ needs.all_assets.outputs.gst22_path }} | |
asset_name: ${{ needs.all_assets.outputs.gst22_name }} | |
overwrite: true | |
- name: Python upload | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ github.ref }} | |
file: ${{ needs.all_assets.outputs.py_path }} | |
asset_name: ${{ needs.all_assets.outputs.py_name }} | |
overwrite: true | |
- name: Web upload | |
uses: svenstaro/upload-release-action@v2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ github.ref }} | |
file: ${{ needs.all_assets.outputs.web_path }} | |
asset_name: ${{ needs.all_assets.outputs.web_name }} | |
overwrite: true |