Skip to content

Commit a2486e0

Browse files
committed
test something
1 parent 0bb6329 commit a2486e0

22 files changed

Lines changed: 962 additions & 68 deletions

.github/workflows/publish.yml

Lines changed: 0 additions & 68 deletions
This file was deleted.

.github/workflows/release.sh

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/bash
2+
# Release script run in Github CI
3+
4+
BRANCH="$1"
5+
6+
LAST_TAG=$(git tag | sort -t '.' --numeric-sort -k1,1 -k2,2 -k3,3 | tail -n 1)
7+
LAST_TAG_MAJOR=$(echo "$LAST_TAG" | cut -d'.' -f1)
8+
LAST_TAG_MINOR=$(echo "$LAST_TAG" | cut -d'.' -f2)
9+
LAST_TAG_PATCH=$(echo "$LAST_TAG" | cut -d'.' -f3)
10+
11+
git show --compact-summary "$LAST_TAG..HEAD" > CHANGELOG
12+
13+
TAG_MAJOR=""
14+
TAG_MINOR=""
15+
TAG_PATCH=""
16+
17+
WARNINGS=""
18+
19+
if grep -q "^ MAJOR" CHANGELOG; then
20+
TAG_MAJOR=$((LAST_TAG_MAJOR + 1))
21+
TAG_MINOR="0"
22+
TAG_PATCH="0"
23+
elif grep -q "^ MINOR" CHANGELOG; then
24+
TAG_MAJOR=$((LAST_TAG_MAJOR + 0))
25+
TAG_MINOR=$((LAST_TAG_MINOR + 1))
26+
TAG_PATCH="0"
27+
elif grep -q "^ PATCH" CHANGELOG; then
28+
TAG_MAJOR=$((LAST_TAG_MAJOR + 0))
29+
TAG_MINOR=$((LAST_TAG_MINOR + 0))
30+
TAG_PATCH=$((LAST_TAG_PATCH + 1))
31+
else
32+
WARNINGS="$WARNINGS ; This release is created with default bump version because no commits was ok"
33+
TAG_MAJOR=$((LAST_TAG_MAJOR + 0))
34+
TAG_MINOR=$((LAST_TAG_MINOR + 0))
35+
TAG_PATCH=$((LAST_TAG_PATCH + 1))
36+
fi
37+
38+
TAG="$TAG_MAJOR.$TAG_MINOR.$TAG_PATCH"
39+
40+
gh release create "$TAG" \
41+
--title "v$TAG" \
42+
--generate-notes \
43+
--target "$BRANCH"
44+
45+
echo "release_tag=$TAG" >> $GITHUB_OUTPUT
46+
echo "$WARNINGS"

.github/workflows/release.yml

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [main, dev]
6+
7+
env:
8+
BRANCH: "main"
9+
10+
jobs:
11+
release-create:
12+
permissions: write-all
13+
runs-on: ubuntu-latest
14+
15+
outputs:
16+
release: ${{ steps.release.outputs.release_tag }}
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-depth: 0
23+
24+
- id: release
25+
name: Create Release
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
run: |
29+
if [[ "${{ github.ref }}" == 'refs/heads/main' ]]; then
30+
export GITHUB_OUTPUT=$GITHUB_OUTPUT
31+
bash ./.github/workflows/release.sh "${{ env.BRANCH }}"
32+
else
33+
echo "release_tag=0.0.0" >> $GITHUB_OUTPUT
34+
fi
35+
36+
release-windows:
37+
runs-on: windows-latest
38+
needs: [release-create]
39+
permissions:
40+
contents: write
41+
42+
steps:
43+
- name: Checkout
44+
uses: actions/checkout@v4
45+
46+
- name: Install winget
47+
uses: Cyberboss/install-winget@v1
48+
with:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
51+
- name: Install dependencies
52+
run: ./scripts/install-deps-windows.ps1
53+
54+
- name: Build
55+
run: ./scripts/bundle-windows.ps1
56+
57+
- name: Upload To Release
58+
if: github.ref == 'refs/heads/main'
59+
env:
60+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+
run: |
62+
gh release upload ${{ needs.release-create.outputs.release }} ./fbttf-windows.zip
63+
gh release upload ${{ needs.release-create.outputs.release }} ./fbttf-windows.exe
64+
65+
- name: Upload To Artifact
66+
if: github.ref != 'refs/heads/main'
67+
uses: actions/upload-artifact@v3
68+
with:
69+
name: fbttf-windows.zip
70+
path: ./fbttf-windows.zip
71+
72+
- name: Upload To Artifact
73+
if: github.ref != 'refs/heads/main'
74+
uses: actions/upload-artifact@v3
75+
with:
76+
name: fbttf-windows.exe
77+
path: ./fbttf-windows.exe
78+
79+
release-linux:
80+
runs-on: ubuntu-latest
81+
needs: [release-create]
82+
permissions:
83+
contents: write
84+
85+
steps:
86+
- name: Checkout
87+
uses: actions/checkout@v4
88+
89+
- name: Install dependencies
90+
run: sudo bash ./scripts/install-deps-linux.sh
91+
92+
- name: Build
93+
run: bash ./scripts/bundle-linux.sh
94+
95+
- name: Upload To Release
96+
if: github.ref == 'refs/heads/main'
97+
env:
98+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
99+
run: |
100+
gh release upload ${{ needs.release-create.outputs.release }} ./fbttf-linux.tar.gz
101+
gh release upload ${{ needs.release-create.outputs.release }} ./fbttf-linux.sh
102+
103+
- name: Upload To Artifact
104+
if: github.ref != 'refs/heads/main'
105+
uses: actions/upload-artifact@v3
106+
with:
107+
name: fbttf-linux.tar.gz
108+
path: ./fbttf-linux.tar.gz
109+
110+
- name: Upload To Artifact
111+
if: github.ref != 'refs/heads/main'
112+
uses: actions/upload-artifact@v3
113+
with:
114+
name: fbttf-linux.sh
115+
path: ./fbttf-linux.sh
116+
117+
release-macos:
118+
runs-on: macos-latest
119+
needs: [release-create]
120+
permissions:
121+
contents: write
122+
123+
steps:
124+
- name: Checkout
125+
uses: actions/checkout@v4
126+
127+
- name: Install dependencies
128+
run: zsh ./scripts/install-deps-macos.sh
129+
130+
- name: Build
131+
run: zsh ./scripts/bundle-macos.sh
132+
133+
- name: Upload To Release
134+
if: github.ref == 'refs/heads/main'
135+
env:
136+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
137+
run: |
138+
gh release upload ${{ needs.release-create.outputs.release }} ./fbttf-macos.zip
139+
gh release upload ${{ needs.release-create.outputs.release }} ./fbttf-macos.dmg
140+
141+
- name: Upload To Artifact
142+
if: github.ref != 'refs/heads/main'
143+
uses: actions/upload-artifact@v3
144+
with:
145+
name: fbttf-macos.dmg
146+
path: ./fbttf-macos.dmg
147+
148+
- name: Upload To Artifact
149+
if: github.ref != 'refs/heads/main'
150+
uses: actions/upload-artifact@v3
151+
with:
152+
name: fbttf-macos.zip
153+
path: ./fbttf-macos.zip

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ my_rpg
88
butto.png
99
vgcore*
1010
debug/
11+
build/

0 commit comments

Comments
 (0)