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

Add AppImageBuilder #80

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
Add version labels to generated artifacts
Add version, arch and os labels to generated artifacts.
Remove now unneeded VERSION file.
  • Loading branch information
lulol authored Aug 10, 2024
commit 2a8ec5e27a30afb615ef0b11f23c1bc1f9129bc7
37 changes: 23 additions & 14 deletions .github/workflows/appimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ env:

jobs:
build:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think ideally this build part of pipeline should be move to main pipeline, and then here keep only appimage (and use artifacts produced by main build pipeline)

runs-on: ubuntu-22.04
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04]

steps:
- name: Checkout code
Expand All @@ -30,22 +33,25 @@ jobs:

- name: Save version file
run: |
./mlnet -v 2>&1 | sed -ne "1s#^.*Starting MLDonkey \([^ ]\+\) .*#\1#p" > VERSION
echo "VERSION=$(cat VERSION)"
VERSION=$(./mlnet -v 2>&1 | sed -ne "1s#^.*Starting MLDonkey \([^ ]\+\) .*#\1#p")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there should be better way to get version without running the binary. Worst case can grep configure log, or actually this :

$ ocaml -e '#use "src/utils/lib/autoconf.ml";; print_endline current_version'
3.2.1.git

see ocaml/ocaml#13637 for why less ugly methods don't work

{
echo "APP_VERSION=$VERSION"
echo "HOST_TYPE=$HOSTTYPE"
echo "OS_TYPE=${{matrix.os}}"
} | tee -a $GITHUB_ENV

- name: Upload mlnet and mlgui binaries
uses: actions/upload-artifact@v4
with:
name: mlnet and mlgui
name: mlnet-and-mlgui-${{env.APP_VERSION}}-${{env.HOST_TYPE}}-${{env.OS_TYPE}}
path: |
mlnet
mlgui
VERSION

- name: Upload utils
uses: actions/upload-artifact@v4
with:
name: Utils
name: mldonkey-utils-${{env.APP_VERSION}}-${{env.HOST_TYPE}}-${{env.OS_TYPE}}
path: |
bt_dht_node
copysources
Expand All @@ -54,19 +60,22 @@ jobs:
mld_hash
subconv
svg_converter
VERSION
if-no-files-found: warn

- name: Upload mlnet+gui binary
uses: actions/upload-artifact@v4
with:
name: mlnet+gui
path: |
mlnet+gui
VERSION
name: mlnet+gui-${{env.APP_VERSION}}-${{env.HOST_TYPE}}-${{env.OS_TYPE}}
path: mlnet+gui
if-no-files-found: warn

outputs:
APP_VERSION: ${{env.APP_VERSION}}
HOST_TYPE: ${{env.HOST_TYPE}}
OS_TYPE: ${{env.OS_TYPE}}

appimage:
if: ${{ needs.build.outputs.OS_TYPE == 'ubuntu-22.04' }}
needs: build
runs-on: ubuntu-22.04
steps:
Expand All @@ -76,7 +85,7 @@ jobs:
- name: Download mlnet+gui binary
uses: actions/download-artifact@v4
with:
name: mlnet+gui
name: mlnet+gui-${{needs.build.outputs.APP_VERSION}}-${{needs.build.outputs.HOST_TYPE}}-${{needs.build.outputs.OS_TYPE}}

- name: Install dependencies
run: sudo apt-get install -y --no-install-recommends libfuse2
Expand All @@ -93,7 +102,7 @@ jobs:
- name: Build AppImage
run: |
# Get application version
APP_VERSION="$(cat VERSION)"
APP_VERSION="${{needs.build.outputs.APP_VERSION}}"
echo "APP_VERSION=$APP_VERSION"
export APP_VERSION
# Download appimage-builder
Expand All @@ -111,6 +120,6 @@ jobs:
- name: Upload AppImage
uses: actions/upload-artifact@v4
with:
name: mldonkey_AppImage
name: mldonkey-${{needs.build.outputs.APP_VERSION}}-${{needs.build.outputs.HOST_TYPE}}.AppImage
path: mldonkey-*.AppImage