Skip to content

Release

Release #22

Workflow file for this run

name: Release
on:
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
env:
COMMIT_EMAIL: [email protected]
COMMIT_MESSAGE: "Release https://github.com/TaloDev/unity/releases/tag/${{ github.ref_name }}"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Copy files
run: |
mkdir -p Release/Samples~
cp -a Packages/com.trytalo.talo/. Release
cp -a Assets/Samples/. Release/Samples~
- name: Copy to package repo (main branch)
uses: tudddorrr/github-action-push-to-another-repository@main
if: "!contains(github.event.head_commit.message, '--no-release') && !contains(github.event.head_commit.message, 'pre.')"
env:
API_TOKEN_GITHUB: ${{ secrets.PAT }}
with:
source-directory: Release
destination-github-username: TaloDev
destination-repository-name: unity-package
user-email: ${{ env.COMMIT_EMAIL }}
commit-message: ${{ env.COMMIT_MESSAGE }}
- name: Copy to package repo (version branch)
uses: tudddorrr/github-action-push-to-another-repository@main
env:
API_TOKEN_GITHUB: ${{ secrets.PAT }}
with:
source-directory: Release
destination-github-username: TaloDev
destination-repository-name: unity-package
user-email: ${{ env.COMMIT_EMAIL }}
commit-message: ${{ env.COMMIT_MESSAGE }}
target-branch: ${{ github.ref_name }}
- name: Create artifact
run: |
cd Release
npm pack
- name: Set itch package path
id: find-package
run: |
filepath="`ls Release | grep .tgz`"
echo "filepath=$filepath" >> $GITHUB_OUTPUT
- name: Upload to itch
uses: manleydev/butler-publish-itchio-action@master
env:
BUTLER_CREDENTIALS: ${{ secrets.BUTLER_CREDENTIALS }}
CHANNEL: package
ITCH_GAME: talo-unity
ITCH_USER: sleepystudios
PACKAGE: Release/${{ steps.find-package.outputs.filepath }}
VERSION: ${{ github.ref_name }}
- name: Create release
uses: softprops/action-gh-release@v2
if: "!contains(github.event.head_commit.message, '--no-release')"
with:
generate_release_notes: true
prerelease: ${{ contains(github.event.head_commit.message, 'pre.') }}
files: Release/*.tgz