Create Release #139
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: "Create Release" | |
on: | |
workflow_run: | |
workflows: ["Tag Release"] | |
types: | |
- completed | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
lfs: true | |
ref: ${{ env.LATEST_TAG }} | |
- name: Get the latest tag | |
run: | | |
git fetch --tags | |
LATEST_TAG="$(git describe --tags "$(git rev-list --tags --max-count=1)")" | |
echo "LATEST_TAG=${LATEST_TAG}" >> "$GITHUB_ENV" | |
- name: Pull LFS | |
run: git lfs pull | |
- name: Archive Release | |
uses: thedoctor0/[email protected] | |
with: | |
type: 'zip' | |
filename: 'Immutable-Passport.zip' | |
directory: './src/Packages' | |
path: './Passport' | |
- name: Build Changelog | |
id: github_release | |
uses: mikepenz/release-changelog-builder-action@v3 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
configurationJson: | | |
{ | |
"pr_template": "- #{{TITLE}} (##{{NUMBER}})", | |
"categories": [ | |
{ | |
"title": "## Features", | |
"labels": ["feature", "feat"] | |
}, | |
{ | |
"title": "## Fixes", | |
"labels": ["fix"] | |
}, | |
{ | |
"title": "## Performance", | |
"labels": ["performance"] | |
}, | |
{ | |
"title": "## Documentation", | |
"labels": ["docs"] | |
}, | |
{ | |
"title": "## Chores", | |
"labels": ["chore"] | |
} | |
] | |
} | |
- name: Extract TS SDK version from index.html | |
id: extract_ts_sdk_version | |
run: | | |
version=$(grep -oP '"x-sdk-version":"ts-immutable-sdk-\K[0-9]+\.[0-9]+\.[0-9]+' ./src/Packages/Passport/Runtime/Resources/index.html | head -n 1) | |
if [[ -z "$version" ]]; then | |
echo "Error: Version not found in index.html" >&2 | |
exit 1 | |
fi | |
version=$(echo "$version" | tr -d '\r\n') | |
echo "VERSION=${version}" >> "$GITHUB_ENV" | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ env.LATEST_TAG }} | |
release_name: ${{ env.LATEST_TAG }} | |
body: | | |
${{steps.github_release.outputs.changelog}} | |
Game bridge built from Immutable Typescript SDK version ${{ env.VERSION }} | |
draft: false | |
prerelease: false | |
- name: Upload release asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./src/Packages/Immutable-Passport.zip | |
asset_name: Immutable-Passport.zip | |
asset_content_type: application/zip |