Skip to content

Auto-Build

Auto-Build #2

Workflow file for this run

on:
workflow_dispatch:
name: Auto-Build
jobs:
build:
name: Build
runs-on: ubuntu-20.04
strategy:
matrix:
architecture: [amd64, arm64, armv7]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Build container for ${{ matrix.architecture }}
run: |
docker build -t builder --build-arg TARGET_ARCH=${{ matrix.architecture }} .
- run: git clone --depth=1 --branch mosh-1.3.2 https://github.com/mobile-shell/mosh.git
- name: Build binaries for ${{ matrix.architecture }}
run: docker run -v $PWD/mosh:/mosh -w /mosh --name=builder builder sh -c './autogen.sh && LDFLAGS=-static ./configure && make'
- uses: actions/upload-artifact@v3
with:
name: mosh-server-${{ matrix.architecture }}
path: mosh/src/frontend/mosh-server
if-no-files-found: error
- uses: actions/upload-artifact@v3
with:
name: mosh-client-${{ matrix.architecture }}
path: mosh/src/frontend/mosh-client
if-no-files-found: error
release:
name: Release
needs: [build]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Download artifacts
uses: actions/download-artifact@v3
- name: Create release description
run: |
(
echo '- [Build #${{ github.run_number }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})'
echo '- [Workflow file](https://github.com/${{ github.repository }}/blob/${{ github.sha }}/.github/workflows/autobuild.yml)'
echo
echo '## Files'
echo '```'
(file mosh-client-*/mosh-client mosh-server-*/mosh-server)
echo '```'
echo
echo '## SHA256 Checksums'
echo '```'
(sha256sum mosh-client-*/mosh-client mosh-server-*/mosh-server)
echo '```'
) | tee release.md
- id: upload_artifact
uses: actions/upload-artifact@v3
with:
name: release.md
path: release.md
if-no-files-found: error
- run: |
for i in mosh-client-*/; do zip -r "${i%/}.zip" "$i"; done
- run: |
for i in mosh-server-*/; do zip -r "${i%/}.zip" $i; done
- name: Create release
uses: softprops/action-gh-release@v1
with:
name: "Build #${{ github.run_number }}"
tag_name: run-${{ github.run_number }}
prerelease: false
draft: false
body_path: release.md
files: |
*.zip