-
Notifications
You must be signed in to change notification settings - Fork 39
133 lines (128 loc) · 5.16 KB
/
ecode-nightly.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: Build Nightly
on:
push:
branches:
- 'develop'
workflow_dispatch:
permissions: write-all
jobs:
release:
name: Create Nightly Release
runs-on: ubuntu-22.04
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
version: ${{ steps.tag.outputs.version }}
steps:
- name: Checkout Code
uses: actions/checkout@v4
with: { fetch-depth: 0, submodules: 'recursive' }
- name: Set Tag
id: tag
run: |
echo "version=nightly" >> "$GITHUB_OUTPUT"
- name: Update Tag
uses: richardsimko/update-tag@v1
with:
tag_name: ${{ steps.tag.outputs.version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.tag.outputs.version }}
name: ecode ${{ steps.tag.outputs.version }}
draft: false
prerelease: true
generate_release_notes: true
body: >
Builds that include most recent changes as they happen. For stable releases check the whole list of [releases](https://github.com/SpartanJ/ecode/releases).
build_linux:
name: Linux
needs: release
strategy:
matrix:
config:
- compiler: default
arch: x86_64
container: ubuntu-22.04
- compiler: gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
arch: aarch64
container: ubuntu-22.04
runs-on: ${{ matrix.config.container }}
env:
CC: gcc
CXX: g++
steps:
- name: Checkout Code
uses: actions/checkout@v4
with: { fetch-depth: 0, submodules: 'recursive' }
- name: Set Environment Variables
run: |
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
echo "/usr/lib/ccache" >> "$GITHUB_PATH"
echo "INSTALL_REF=${{ needs.release.outputs.version }}" >> "$GITHUB_ENV"
if [[ $(uname -m) != ${{ matrix.config.arch }} ]]; then
echo "CC=aarch64-linux-gnu-gcc" >> "$GITHUB_ENV"
echo "CXX=aarch64-linux-gnu-g++" >> "$GITHUB_ENV"
echo "RARCH=arm64" >> "$GITHUB_ENV"
else
echo "RARCH=$(uname -m)" >> "$GITHUB_ENV"
fi
- name: Update Packages
run: |
if [[ $(uname -m) = ${{ matrix.config.arch }} ]]; then
sudo add-apt-repository -y universe
sudo add-apt-repository -y multiverse
sudo apt-get update
else
url="http://ports.ubuntu.com/ubuntu-ports"
repos="main restricted universe multiverse"
echo "deb [arch=arm64] $url jammy $repos" > arm64.list
echo "deb [arch=arm64] $url jammy-updates $repos" >> arm64.list
echo "deb [arch=arm64] $url jammy-security $repos" >> arm64.list
echo "deb [arch=arm64] $url jammy-backports $repos" >> arm64.list
sudo mv arm64.list /etc/apt/sources.list.d/
sudo apt-get update
sudo dpkg --add-architecture arm64
fi
- name: Install dependencies
run: |
sudo apt-get install -y ccache premake4 libfuse2 fuse
if [[ $(uname -m) = "x86_64" ]]; then
sudo apt-get install -y mingw-w64
wget https://github.com/premake/premake-core/releases/download/v5.0.0-beta2/premake-5.0.0-beta2-linux.tar.gz
tar xvzf premake-5.0.0-beta2-linux.tar.gz
fi
if [[ $(uname -m) = ${{ matrix.config.arch }} ]]; then
sudo apt install -y gcc-12 g++-12 libsdl2-2.0-0 libsdl2-dev
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 10
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 10
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 30
sudo update-alternatives --set cc /usr/bin/gcc
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 30
sudo update-alternatives --set c++ /usr/bin/g++
sudo update-alternatives --config gcc
sudo update-alternatives --config g++
else
sudo apt-get install -y libsdl2-dev:arm64 libsdl2-2.0-0:arm64
fi
- name: Install Cross Compiler
if: ${{ matrix.config.compiler != 'default' }}
run: sudo apt-get install -y ${{ matrix.config.compiler }}
- name: Build ecode
run: |
bash projects/linux/ecode/build.app.sh --version ${{ env.INSTALL_REF }} --arch ${{ matrix.config.arch }}
if [[ $(uname -m) = "x86_64" ]]; then
bash projects/mingw32/ecode/build.app.sh --version ${{ env.INSTALL_REF }}
fi
- name: Upload Files
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.release.outputs.version }}
draft: false
prerelease: true
files: |
projects/linux/ecode/ecode-linux-${{ env.INSTALL_REF }}-${{ env.RARCH }}.AppImage
projects/linux/ecode/ecode-linux-${{ env.INSTALL_REF }}-${{ env.RARCH }}.tar.gz
projects/mingw32/ecode/ecode-windows-${{ env.INSTALL_REF }}-${{ env.RARCH }}.zip