Release Unity package #8
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
name: "Release Unity package" | |
on: | |
push: | |
tags: | |
- v1* | |
jobs: | |
release: | |
name: release | |
runs-on: ubuntu-20.04 | |
steps: | |
# Git checkout | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
# The github.ref is, for example, refs/tags/v1.0.52 | |
# Generate variables like: | |
# SRS_TAG=v1.0.52 | |
# SRS_MAJOR=1 | |
# @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 | |
SRS_MAJOR=$(echo $SRS_TAG| cut -c 2) | |
echo "SRS_MAJOR=$SRS_MAJOR" >> $GITHUB_ENV | |
SRS_FILE="objs/SRS.WebRTC.Samples.unitypackage" | |
echo "SRS_FILE=$SRS_FILE" >> $GITHUB_ENV | |
# Generate metadata list for Unity package. | |
- name: Generate metadata list | |
run: | | |
find src/Assets -name \*.meta >> metaList | |
mkdir -p objs | |
- uses: pCYSl5EDgo/create-unitypackage@master | |
with: | |
package-path: ${{ env.SRS_FILE }} | |
include-files: metaList | |
# Create release. | |
- name: Create release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
body: | | |
${{ github.event.head_commit.message }} | |
draft: false | |
prerelease: false | |
# Upload release source files | |
- name: Upload Release Assets Source | |
id: upload-release-assets-source | |
uses: dwenegar/upload-release-assets@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
release_id: ${{ steps.create_release.outputs.id }} | |
assets_path: ${{ env.SRS_FILE }} | |