Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create new appimage workflow #278

Merged
merged 26 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
5388759
Create new appimage workflow
Jammyjamjamman Sep 21, 2024
790a981
Don't use 'out' directory (#279)
andy5995 Sep 24, 2024
dd76ad7
remove "cd out" from appimage.yml
Jammyjamjamman Sep 24, 2024
34c4d75
Generate multiple checksums (#280)
andy5995 Sep 25, 2024
81a1c37
Fix artifact naming bug in appimage.yml
Jammyjamjamman Sep 25, 2024
ec37f15
Use curl, and more variables (#281)
andy5995 Sep 26, 2024
b6e698e
Set install prefix, prevent duplicates (#282)
andy5995 Oct 4, 2024
e83c31b
Use andy5995/linuxdeploy:v2 instead of ':latest'
andy5995 Oct 9, 2024
82f0245
Add data to megaglest-game appimages
Jammyjamjamman Oct 12, 2024
f2463c7
appimage.yml: Use v2-focal instead of v2
andy5995 Oct 16, 2024
0aac2f2
appimage.yml: Assign version based on workflow dispatch input
andy5995 Oct 16, 2024
65db7bf
Package all 3 binaries
andy5995 Oct 16, 2024
cd2a1c7
build-appimage.sh: Edit test instructions [skip ci]
andy5995 Oct 17, 2024
3682850
Remove SOURCE_ROOT variable and experimental shared library arg
andy5995 Nov 27, 2024
750f078
Actually use the docker-compose.yml added in previous commit
andy5995 Nov 27, 2024
21448f0
Add comments to compose yml and .env, move vars from .env to compose
andy5995 Nov 27, 2024
058396e
Don't bother setting WORKSPACE in the script
andy5995 Nov 27, 2024
a20e385
Don't build on arm/v7
andy5995 Dec 29, 2024
c1409ac
Install far few packages with --no-install-recommends
andy5995 Dec 29, 2024
e1abda7
Use v3 instead of v2, remove entrypoint
andy5995 Dec 29, 2024
cb3bbcc
Specify v3.2.0 for qemu action
andy5995 Jan 24, 2025
9a965a5
Revert cb3bbcc
andy5995 Jan 24, 2025
f40e4da
Add CC and CXX variables docker-compose
Jammyjamjamman Jan 25, 2025
b31b0ae
Use jammy image instead of focal
andy5995 Jan 25, 2025
4fd0364
Use native arm64 runner
andy5995 Jan 25, 2025
162b85d
New workflows for the AppImage
Jammyjamjamman Jan 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions .github/workflows/appimage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Build MG AppImage
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true

on:
workflow_dispatch:
inputs:
version:
description: 'version number'
required: false
type: string
push:
branches: develop
pull_request:
branches: develop

jobs:
build-mg-appimage:
runs-on: ${{ matrix.os }}
env:
VERSION: ${{ inputs.version }}
strategy:
matrix:
os:
- ubuntu-24.04-arm
- ubuntu-24.04

steps:
- name: Checkout MegaGlest
uses: actions/checkout@v4

- name: Checkout Data
uses: actions/checkout@v4
with:
repository: "megaglest/megaglest-data"
path: "data/glest_game"

- name: Build AppImage
run: |
export HOSTUID=$(id -u) HOSTGID=$(id -g)
docker compose -f mk/linux/docker/docker-compose.yml run --rm build

- name: Create sha256sum
run: |
for file in *.AppImage; do
sha256sum "$file" > "$file.sha256sum";
done

- name: Artifact Filename
run: |
PLATFORM=$(uname -m)
echo "ARTIFACT_NAME=AppImages-${PLATFORM//\//-}" >> $GITHUB_ENV

- if: ${{ github.ref != 'refs/heads/develop' }}
name: Upload AppImage
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}
path: ./*AppImage*
if-no-files-found: error

- if: ${{ github.ref == 'refs/heads/develop' }}
name: 'Prerelease'
uses: ncipollo/release-action@v1
with:
artifacts: "./*AppImage*"
body: "MegaGlest Snapshot Release"
allowUpdates: true
prerelease: true
removeArtifacts: false
replacesArtifacts: true
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
tag: snapshot
22 changes: 4 additions & 18 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,9 @@ on:
branches: [ develop ]
pull_request:
branches: [ develop ]
workflow_run:
workflows: [Docker Image]
types: [completed]
branches: [develop]

jobs:
build-linux:
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -51,7 +46,6 @@ jobs:
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -121,27 +115,18 @@ jobs:
$7zPath = $(Get-Command 7z).Source
cp $7zPath .
Remove-Item glest-dev.ini
Compress-Archive -Path *.exe,*.ini -DestinationPath megaglest-$env:VERSION-x64-windows.zip
Compress-Archive -Path *.exe,*.ini -DestinationPath megaglest-x64-windows.zip
cd ../..

- name: Create MegaGlest Snapshot
if: ${{ github.ref == 'refs/heads/develop' }}
uses: actions/upload-artifact@v4
with:
name: megaglest-x64-windows
name: megaglest-x64-windows-archive
retention-days: 1
path: mk/windoze/*.zip

on-dockerbuild-failure:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
steps:
- run: |
echo 'The triggering workflow failed'
exit 1

build-macos:
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
strategy:
fail-fast: false
runs-on: macos-latest
Expand All @@ -168,7 +153,7 @@ jobs:
cd mk/macos
./make-binary-archive.sh
cd -
mv release/mg-binary-macos*.tar.bz2 release/megaglest-$VERSION-x64-macos.tar.bz2
mv release/mg-binary-macos*.tar.bz2 release/megaglest-x64-macos.tar.bz2

- name: Create MegaGlest Snapshot
if: ${{ github.ref == 'refs/heads/develop' }}
Expand All @@ -177,3 +162,4 @@ jobs:
name: megaglest-x64-macos
retention-days: 1
path: release/*.tar.bz2

39 changes: 0 additions & 39 deletions .github/workflows/docker.yml

This file was deleted.

84 changes: 0 additions & 84 deletions .github/workflows/prerelease.yml

This file was deleted.

93 changes: 22 additions & 71 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,7 @@ on:

# The artifact only runs on the same distro that it was built on.
jobs:
appimage-snapshot:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
container: megaglest/megaglest-build-env:bionic
steps:
- uses: actions/checkout@v4

- name: Git Hash
run: |
# Required because docker user is root.
git config --global safe.directory $GITHUB_WORKSPACE
echo "VERSION=$(git rev-parse --short HEAD)" >> $GITHUB_ENV

- name: Build
run: mk/linux/build-appimage.sh

- name: Pack
run: |
cd mk/linux/
mv g2xml g2xml-$VERSION
mv xml2g xml2g-$VERSION
tar cfJ megaglest-$VERSION-x64-appimage.tar.xz *.AppImage g2xml-* xml2g-*

- name: Create MegaGlest Snapshot
uses: actions/upload-artifact@v4
with:
name: megaglest-x64-ubuntu
retention-days: 1
path: |
mk/linux/*.tar.xz

transfer-macos-snapshot:
release:
runs-on: ubuntu-latest
permissions:
contents: write
Expand All @@ -67,55 +36,37 @@ jobs:
});
let fs = require('fs');
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/megaglest-x64-macos.zip`, Buffer.from(download.data));
- name: 'Prepare artifacts'
run: |
unzip megaglest-x64-macos.zip
rm megaglest-x64-macos.zip
- name: Create MegaGlest MacOS Snapshot
uses: actions/upload-artifact@v4
with:
name: megaglest-x64-macos
retention-days: 1
path: |
*.tar.bz2

transfer-windows-snapshot:
runs-on: ubuntu-latest
permissions:
contents: write
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: 'Download artifact'
uses: actions/github-script@v7
with:
script: |
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.payload.workflow_run.id,
});
let matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
return artifact.name == "megaglest-x64-windows"
matchArtifact = allArtifacts.data.artifacts.filter((artifact) => {
return artifact.name == "megaglest-x64-windows-archive"
})[0];
let download = await github.rest.actions.downloadArtifact({
download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
let fs = require('fs');
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/megaglest-x64-windows.zip`, Buffer.from(download.data));
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/megaglest-x64-windows-archive.zip`, Buffer.from(download.data));

- name: 'Prepare artifacts'
run: |
unzip megaglest-x64-windows.zip
rm megaglest-x64-windows.zip
- name: Create MegaGlest Windows Snapshot
uses: actions/upload-artifact@v4
unzip megaglest-x64-windows-archive.zip
unzip megaglest-x64-macos.zip
rm megaglest-x64-windows-archive.zip megaglest-x64-macos.zip

- name: 'Prerelease'
uses: ncipollo/release-action@v1
with:
name: megaglest-x64-windows
retention-days: 1
path: |
*.zip
artifacts: "*.zip,*.tar.bz2"
body: "MegaGlest Snapshot Release"
allowUpdates: true
prerelease: true
removeArtifacts: false
replacesArtifacts: true
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
tag: snapshot


on-failure:
runs-on: ubuntu-latest
Expand Down
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ Session.vim
# Emacs
\#*\#

# AppImage
CMakeFiles/
_build_appimage/

# These are output to the source root when the appimage script is run:
#/xml2g
#/g2xml

## macOS
*.DS_Store
Icon
Expand Down
Loading
Loading