Skip to content

Commit 8938a8e

Browse files
committed
Add GitHub action for macOS release
1 parent e46094d commit 8938a8e

1 file changed

Lines changed: 53 additions & 0 deletions

File tree

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Release MacOS x64 Version to itch.io
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
git-tag:
7+
description: 'The git tag which which is used for the release'
8+
required: true
9+
default: 1.0.2
10+
11+
jobs:
12+
release-macos_x64:
13+
runs-on: macos-13
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
ref: master
18+
fetch-depth: 0
19+
- name: Fetch Git Tags
20+
run: git fetch --all --tags --prune
21+
- name: Git Checkout Tag
22+
run: git checkout tags/${{github.event.inputs.git-tag}} -b release/${{github.event.inputs.git-tag}}
23+
- uses: graalvm/setup-graalvm@v1
24+
with:
25+
java-version: '21'
26+
distribution: 'graalvm'
27+
github-token: ${{ secrets.GITHUB_TOKEN }}
28+
- name: Maven Build
29+
run: mvn clean install -Pnative
30+
- name: Download itch.io Butler
31+
run: curl -L -o butler.zip https://broth.itch.ovh/butler/darwin-amd64/LATEST/archive/default
32+
- name: Unzip itch.io Butler
33+
run: unzip butler.zip
34+
- name: Make Executable
35+
run: chmod +x butler
36+
- name: Create release Folder
37+
run: mkdir nibbles-clone-v${{github.event.inputs.git-tag}}
38+
- name: Create data Folder
39+
run: mkdir nibbles-clone-v${{github.event.inputs.git-tag}}/data
40+
41+
- name: list directory
42+
run: ls -lha
43+
44+
- name: Copy Assets to release Folder
45+
run: cp -R "data/" "nibbles-clone-v${{github.event.inputs.git-tag}}/data"
46+
- name: Copy Binaries to release Folder
47+
run: cp "target/nibbles-clone" "nibbles-clone-v${{github.event.inputs.git-tag}}"
48+
- name: Zip release folder
49+
run: zip -r nibbles-clone-v${{github.event.inputs.git-tag}}.zip nipples-clone-v${{github.event.inputs.git-tag}}/
50+
- name: Deploy to itch.io
51+
env:
52+
BUTLER_API_KEY: ${{secrets.BUTLER_API_KEY}}
53+
run: ./butler push nipples-clone-v${{github.event.inputs.git-tag}}.zip mwttg/nibbles-clone:win --userversion ${{github.event.inputs.git-tag}}

0 commit comments

Comments
 (0)