Skip to content

Rlease package

Rlease package #33

Workflow file for this run

name: Rlease package
on:
create:
tags:
- "*.*.*"
workflow_dispatch:
env:
packageName: "pl.krysiek.cutedancer"
packageFolder: "Packages/pl.krysiek.cutedancer"
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Replace version in files with tag
run: |
sed -i -e "s/0.0.0-dev/$GITHUB_REF_NAME/g" "${{ env.packageFolder }}/package.json"
sed -i -e "s/0.0.0-dev/$GITHUB_REF_NAME/g" "${{ env.packageFolder }}/README.txt"
sed -i -e "s/0.0.0-dev/$GITHUB_REF_NAME/g" "${{ env.packageFolder }}/Editor/Resources/CuteDancer/Views/MainView.uxml"
sed -i -e "s/0.0.0-dev/$GITHUB_REF_NAME/g" "${{ env.packageFolder }}/Editor/Data/BuildInfoData.cs"
- name: Get version
id: version
uses: notiz-dev/github-action-json-property@v0.2.0
with:
path: "Packages/${{env.packageName}}/package.json"
prop_path: "version"
- name: Set Environment Variables
run: |
echo "zipFile=${{ env.packageName }}-${{ steps.version.outputs.prop }}".zip >> $GITHUB_ENV
echo "unityPackage=${{ env.packageName }}-${{ steps.version.outputs.prop }}.unitypackage" >> $GITHUB_ENV
- name: Create Zip
uses: TheDoctor0/zip-release@0.7.1
with:
type: "zip"
directory: "Packages/${{env.packageName}}/"
filename: "../../${{env.zipFile}}" # make the zip file two directories up, since we start two directories in above
- run: find "Packages/${{env.packageName}}/" -name \*.meta >> metaList
- name: Create UnityPackage
uses: pCYSl5EDgo/create-unitypackage@v1.1.1
with:
package-path: ${{ env.unityPackage }}
include-files: metaList
- name: Make Release
uses: softprops/action-gh-release@v0.1.15
with:
tag_name: ${{ steps.version.outputs.prop }}
files: |
${{ env.zipFile }}
${{ env.unityPackage }}
Packages/${{ env.packageName }}/package.json
draft: true