-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (66 loc) · 2.63 KB
/
create-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
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:
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
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:
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
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: Remove the version from the artifact name
run: |
filepath=$(ls Release/*.tgz)
new_filepath=$(echo "$filepath" | sed -E 's/-[0-9]+\.[0-9]+\.[0-9]+\.tgz$/.tgz/')
mv "$filepath" "$new_filepath"
- 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/com.trytalo.talo.tgz
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