# HG changeset patch # User Edouard Tisserant # Date 1659282859 -7200 # Node ID 1088ce57d3c9092a73df90c2e01886eee02ac8fc # Parent a8b43460589526a91d11c54581c045f6b231a587 Add (untested) snapcraft workflow for GitHub action. Add documentation about manual snapcraft invokation. diff -r a8b434605895 -r 1088ce57d3c9 .github/workflows/build_bundles.yml --- a/.github/workflows/build_bundles.yml Sun Jul 31 16:43:25 2022 +0200 +++ b/.github/workflows/build_bundles.yml Sun Jul 31 17:54:19 2022 +0200 @@ -1,4 +1,4 @@ -name: Build windows installer in Docker. +name: Build windows installer in Docker on: workflow_dispatch: diff -r a8b434605895 -r 1088ce57d3c9 .github/workflows/build_snap.yml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.github/workflows/build_snap.yml Sun Jul 31 17:54:19 2022 +0200 @@ -0,0 +1,40 @@ +name: Build Snap + +on: + workflow_dispatch: + # push: + # branches: [ default ] + +jobs: + sources: + uses: ./.github/workflows/prep_sources.yml + + build: + needs: sources + runs-on: ubuntu-latest + + steps: + - name: Download source artifact + uses: actions/download-artifact@v3 + with: + name: source_package + + - uses: actions/checkout@v3 + with: + # checkout directly in build/sources so that + # sources dirs are aside snap dir + path: build/sources + + - name: Invoke snapcraft build + uses: snapcore/action-build@v1 + id: snapcraft + with: + path: build/sources + + - name: Upload built artifact + uses: actions/upload-artifact@v3 + with: + name: snap + path: ${{ steps.snapcraft.outputs.snap }} + + diff -r a8b434605895 -r 1088ce57d3c9 README.md --- a/README.md Sun Jul 31 16:43:25 2022 +0200 +++ b/README.md Sun Jul 31 17:54:19 2022 +0200 @@ -17,7 +17,7 @@ Reference build environment is obtained by applying [provision_focal64.sh](provision_focal64.sh) on Ubuntu 20.04 amd64. -## Build ## +## Preparing source ## The top Makefile expects source code of Beremiz, Matiec and CanFestival to be sibling to beremiz_public_dist directory, in the 'source directory'. @@ -27,7 +27,7 @@ ~/src /beremiz /beremiz_public_dist - /CanFestival-3 + /canfestival /matiec ``` @@ -37,6 +37,8 @@ Intermediate and final results are all placed in a single 'build directory' during build process. +## Windows installer Build ## + ### Prepare Docker image ### The script [rebuild_docker.sh](rebuild_docker.sh) is used for that purpose. @@ -49,7 +51,7 @@ ``` #!sh -mkdir ~/src +mkdir ~/src ~/build cd ~/src hg clone https://hg.beremiz.org/beremiz_public_dist cd beremiz_public_dist @@ -87,7 +89,7 @@ Resulting installer is Beremiz-1.2.exe in 'build directory'. -## Manhole ## +### Manhole ### Once Docker image ready, the scripts [enter_docker.sh](enter_docker.sh) and [enter_docker_as_root.sh](enter_docker_as_root.sh) let you issue build @@ -96,3 +98,26 @@ [clean_docker_container.sh](clean_docker_container.sh) and [create_docker_container.sh](create_docker_container.sh) and [clean_docker_image.sh](clean_docker_image.sh) and [build_docker_image.sh](build_docker_image.sh) are invoked by [rebuild_docker.sh](rebuild_docker.sh). + +## Snap Package Build ## + +snapcraft.yaml does not rely on HG or GIT repos, but refers to local sources, this is responsibility of caller to prepare sources for snapcraft. + +Reasons for this are : + - no parameters or conditional variables exist to tell snapcraft.yaml where to get the source from + - building from local source should be always possible + - revisions.txt must be updated in any case so that it is always possible to know what version wqas used to build resulting package + - when Snap is built from GitHub actions, Makefile isn't used at all, and GitHub action workflow organize sources and revisions.txt on its own. + +In the end, instead of just calling `snapcraft` to get a snap package, it is more complicated: + +``` +#!sh +mkdir ~/src ~/build +cd ~/src +hg clone https://hg.beremiz.org/beremiz_public_dist +cd ~/build +make -f ~/src/beremiz_public_dist/Makefile DIST=snap + +``` +