Create tools for ffmpeg, ffprobe. #311
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
name: "Release" | |
# @see https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#onpushpull_requestbranchestags | |
on: | |
push: | |
branches: | |
- 'tools' | |
jobs: | |
envs: | |
name: envs | |
steps: | |
################################################################################################################## | |
# Git checkout | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
# The github.ref is, for example, refs/tags/v5.0.145 or refs/tags/v5.0-r8 | |
# Generate variables like: | |
# SRS_TAG=tools-v1.0.52 | |
# @see https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable | |
- name: Generate varaiables | |
run: | | |
SRS_TAG=$(echo ${{ github.ref }}| awk -F '/' '{print $3}') | |
echo "SRS_TAG=$SRS_TAG" >> $GITHUB_ENV | |
# Map a step output to a job output, see https://docs.github.com/en/actions/using-jobs/defining-outputs-for-jobs | |
outputs: | |
SRS_TAG: ${{ env.SRS_TAG }} | |
runs-on: ubuntu-20.04 | |
docker: | |
needs: | |
- envs | |
steps: | |
- name: Covert output to env | |
run: | | |
echo "SRS_TAG=${{ needs.envs.outputs.SRS_TAG }}" >> $GITHUB_ENV | |
# Git checkout | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
# See https://github.com/crazy-max/ghaction-docker-buildx#moved-to-docker-organization | |
# https://github.com/docker/setup-qemu-action | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
# https://github.com/docker/setup-buildx-action | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
# Create main images for Docker | |
- name: Login to docker hub | |
uses: docker/login-action@v2 | |
with: | |
username: "${{ secrets.DOCKER_USERNAME }}" | |
password: "${{ secrets.DOCKER_PASSWORD }}" | |
# Build SRS image | |
- name: Build SRS docker image | |
run: | | |
echo "Release ossrs/srs:$SRS_TAG" | |
docker buildx build --platform linux/arm/v7,linux/arm64/v8,linux/amd64 \ | |
--output "type=image,push=true" \ | |
--tag ossrs/srs:$SRS_TAG -f Dockerfile . | |
name: release-docker | |
runs-on: ubuntu-20.04 | |
aliyun: | |
needs: | |
- envs | |
- docker | |
steps: | |
- name: Covert output to env | |
run: | | |
echo "SRS_TAG=${{ needs.envs.outputs.SRS_TAG }}" >> $GITHUB_ENV | |
# Aliyun ACR | |
- name: Login Aliyun docker hub | |
uses: docker/login-action@v1 | |
with: | |
registry: registry.cn-hangzhou.aliyuncs.com | |
username: "${{ secrets.ACR_USERNAME }}" | |
password: "${{ secrets.ACR_PASSWORD }}" | |
- name: Docker alias images for ossrs/srs | |
uses: akhilerm/tag-push-action@v2.1.0 | |
with: | |
src: ossrs/srs:${{ env.SRS_TAG }} | |
dst: | | |
registry.cn-hangzhou.aliyuncs.com/ossrs/srs:${{ env.SRS_TAG }} | |
runs-on: ubuntu-20.04 | |