Skip to content

Commit 0efdfc2

Browse files
committed
Test github actions [DEPLOYMENT]
1 parent 034700a commit 0efdfc2

File tree

1 file changed

+97
-36
lines changed

1 file changed

+97
-36
lines changed

.github/workflows/main.yml

Lines changed: 97 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ on:
2222
required: false
2323
default: 'false'
2424

25-
2625
jobs:
2726
linux:
2827
name: Linux (and Windows) build
@@ -34,7 +33,7 @@ jobs:
3433
- name: Set Custom Build Variables
3534
uses: ./.github/actions/set-custom-build-variables
3635

37-
- name: Deployment request status
36+
- name: Deployment request status check
3837
if: env.should_deploy == 'true'
3938
run: echo "ENABLED (if you see this)"
4039

@@ -80,18 +79,47 @@ jobs:
8079
- name: Test run of MEGA65 emulator
8180
run: build/bin/xmega65.native -h || true
8281

83-
- name: Creating DEB package to be deployed
82+
- name: Creating DEB package to be deployed (Linux)
8483
if: env.should_deploy == 'true'
8584
run: |
8685
make RELEASE=yes OFFICIALBUILD=yes deb
8786
cp build/bin/*.deb build/bin/*.rpm .
8887
ls -l *.deb *.rpm
88+
rm -fr xemu-deploy
89+
build/deploy/before-deploy.sh xemu-deploy Linux
8990
9091
- name: GIT configuration for deployment
9192
if: env.should_deploy == 'true'
9293
run: |
9394
git config --global user.name "GitHub Actions Xemu Linux Builder"
94-
git config --global user.email "[email protected]"
95+
git config --global user.email "[email protected]"
96+
97+
- name: Deployment (Linux)
98+
if: env.should_deploy == 'true'
99+
run: |
100+
cd xemu-deploy
101+
touch .nojekyll
102+
pwd
103+
ls -l
104+
TARGET_BRANCH="binary-linux-${{ github.ref_name }}"
105+
git init
106+
git checkout --orphan "$TARGET_BRANCH"
107+
git add .
108+
git commit -m "Deploy from ${{ github.repository }}@${{ github.sha }}"
109+
git status
110+
git push --force --quiet "https://x-access-token:${{ secrets.XEMU_DEPLOY_TOKEN }}@github.com/lgblgblgb/xemu-binaries.git" "$TARGET_BRANCH:refs/heads/$TARGET_BRANCH"
111+
git pull
112+
git log
113+
cd ..
114+
rm -fr xemu-deploy
115+
116+
- name: Announce deployment (Linux)
117+
if: env.should_deploy == 'true'
118+
run: echo "TODO" ; pwd
119+
120+
- name: Clean-up Linux build artifacts before Windows cross-compilation
121+
if: env.should_deploy == 'true'
122+
run: rm -f *.deb *.rpm build/bin/*.deb build/bin/*.rpm build/bin/*.native
95123

96124
- name: Installing Windows SDL2 cross-development components
97125
run: build/install-cross-win-mingw-sdl-on-linux.sh /usr/bin
@@ -126,36 +154,66 @@ jobs:
126154
if: env.should_deploy == 'true'
127155
run: for a in build/bin/*.win32 ; do ls -l $a ; i686-w64-mingw32-strip $a ; ls -l $a ; done
128156

129-
- name: Create packages to be deployed
130-
if: env.should_deploy == 'truex'
157+
- name: Building ZIP acrhive (Windows, 64 bit)
158+
if: env.should_deploy == 'true'
131159
run: |
132-
cp README.md LICENSE AUTHORS build/bin/
133-
echo "--- Bulding ZIP acrhive ---"
134-
build/zipper.sh build/bin xemu-binaries-osx.zip build/bin/*.dylib build/bin/*.native README.md LICENSE AUTHORS
135-
cp build/bin/xemu-binaries-osx.zip .
136-
ls -l *.zip
137-
echo "--- Creating DMG distribution ---"
138-
build/dmg-osx-creator.sh
139-
echo "--- Before deploy ---"
140-
build/deploy/before-deploy.sh xemu-deploy Linux
160+
rm -f build/bin/*.dll
161+
cp README.md LICENSE AUTHORS `x86_64-w64-mingw32-sdl2-config --prefix`/bin/*.dll build/bin/
162+
build/zipper.sh build/bin xemu-binaries-win64.zip build/bin/*.dll build/bin/*.win64 README.md LICENSE AUTHORS
163+
cp build/bin/xemu-binaries-win64.zip .
164+
165+
- name: Building installer (Windows, 64 bit)
166+
if: env.should_deploy == 'true'
167+
run: |
168+
rm -f build/bin/*.dll
169+
cp README.md LICENSE AUTHORS `x86_64-w64-mingw32-sdl2-config --prefix`/bin/*.dll build/bin/
170+
build/nsi-build-native.sh win64 `build/system-config win64 sdl2 dll` || true
171+
cp build/bin/install-xemu-win64.exe . || true
172+
173+
- name: Building ZIP archive (Windows, 32 bit)
174+
if: env.should_deploy == 'true'
175+
run: |
176+
rm -f build/bin/*.dll
177+
cp README.md LICENSE AUTHORS `i686-w64-mingw32-sdl2-config --prefix`/bin/*.dll build/bin/
178+
build/zipper.sh build/bin xemu-binaries-win32.zip build/bin/*.dll build/bin/*.win32 README.md LICENSE AUTHORS
179+
cp build/bin/xemu-binaries-win32.zip .
141180
142-
- name: Deployment
143-
if: env.should_deploy == 'truex'
181+
- name: Building installer (Windows, 32 bit)
182+
if: env.should_deploy == 'true'
144183
run: |
145-
# Clone shared deployment repo
146-
rm -rf /tmp/shared-deploy-repo
147-
git clone --depth 1 --branch main https://x-access-token:${{ secrets.XEMU_DEPLOY_TOKEN }}@github.com/lgblgblgb/shared-deploy-repo.git /tmp/shared-deploy-repo
184+
rm -f build/bin/*.dll
185+
cp README.md LICENSE AUTHORS `i686-w64-mingw32-sdl2-config --prefix`/bin/*.dll build/bin/
186+
build/nsi-build-native.sh win32 `build/system-config win32 sdl2 dll` || true
187+
cp build/bin/install-xemu-win32.exe . || true
148188
149-
# Clear and replace linux folder
150-
rm -rf /tmp/shared-deploy-repo/linux
151-
mkdir -p /tmp/shared-deploy-repo/linux
152-
cp -r path/to/build/output/* /tmp/shared-deploy-repo/linux/
189+
- name: Pre-deployment (Windows)
190+
if: env.should_deploy == 'true'
191+
run: |
192+
rm -fr xemu-deploy
193+
build/deploy/before-deploy.sh xemu-deploy Windows
194+
195+
- name: Deployment (Windows)
196+
if: env.should_deploy == 'true'
197+
run: |
198+
cd xemu-deploy
199+
touch .nojekyll
200+
pwd
201+
ls -l
202+
TARGET_BRANCH="binary-windows-${{ github.ref_name }}"
203+
git init
204+
git checkout --orphan "$TARGET_BRANCH"
205+
git add .
206+
git commit -m "Deploy from ${{ github.repository }}@${{ github.sha }}"
207+
git status
208+
git push --force --quiet "https://x-access-token:${{ secrets.XEMU_DEPLOY_TOKEN }}@github.com/lgblgblgb/xemu-binaries.git" "$TARGET_BRANCH:refs/heads/$TARGET_BRANCH"
209+
git pull
210+
git log
211+
cd ..
212+
rm -fr xemu-deploy
153213
154-
# Commit and push!
155-
cd /tmp/shared-deploy-repo
156-
git add linux
157-
git commit -m "Linux deployment from $GITHUB_REPOSITORY ($GITHUB_SHA)"
158-
git push --force
214+
- name: Announce deployment (Windows)
215+
if: env.should_deploy == 'true'
216+
run: echo "TODO" ; pwd
159217

160218
macos:
161219
name: MacOS x86 build
@@ -167,7 +225,7 @@ jobs:
167225
- name: Set Custom Build Variables
168226
uses: ./.github/actions/set-custom-build-variables
169227

170-
- name: Deployment request status
228+
- name: Deployment request status check
171229
if: env.should_deploy == 'true'
172230
run: echo "ENABLED (if you see this)"
173231

@@ -212,7 +270,7 @@ jobs:
212270
- name: Test run of MEGA65 emulator
213271
run: build/bin/xmega65.native -h || true
214272

215-
- name: Create packages to be deployed
273+
- name: Create packages to be deployed (MacOS)
216274
if: env.should_deploy == 'true'
217275
run: |
218276
cp README.md LICENSE AUTHORS build/bin/
@@ -228,31 +286,34 @@ jobs:
228286
which md5sum
229287
md5sum --version
230288
echo "--- Before deploy ---"
289+
rm -fr xemu-deploy
231290
build/deploy/before-deploy.sh xemu-deploy MacOS
232291
233292
- name: GIT configuration for deployment
234293
if: env.should_deploy == 'true'
235294
run: |
236295
git config --global user.name "GitHub Actions Xemu Mac Builder"
237-
git config --global user.email "actions@github.com"
296+
git config --global user.email "lgblgblgb@gmail.com"
238297
239-
- name: Deployment
298+
- name: Deployment (MacOS)
240299
if: env.should_deploy == 'true'
241300
run: |
242301
cd xemu-deploy
243302
touch .nojekyll
244303
pwd
245304
ls -l
246-
SRC_BRANCH="${{ github.ref_name }}"
247-
TARGET_BRANCH="binary-osx-$SRC_BRANCH"
305+
TARGET_BRANCH="binary-osx-${{ github.ref_name }}"
248306
git init
249307
git checkout --orphan "$TARGET_BRANCH"
250308
git add .
251309
git commit -m "Deploy from ${{ github.repository }}@${{ github.sha }}"
252310
git status
253311
git push --force --quiet "https://x-access-token:${{ secrets.XEMU_DEPLOY_TOKEN }}@github.com/lgblgblgb/xemu-binaries.git" "$TARGET_BRANCH:refs/heads/$TARGET_BRANCH"
312+
git pull
313+
git log
254314
cd ..
315+
rm -fr xemu-deploy
255316
256-
- name: Announce deployment
317+
- name: Announce deployment (MacOS)
257318
if: env.should_deploy == 'true'
258319
run: echo "TODO" ; pwd

0 commit comments

Comments
 (0)