From 4223935b124a0b16053aef719abccdc5fca36287 Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Mon, 30 Nov 2020 20:57:20 +0100 Subject: Combine binary workflows into one with multiple jobs --- .github/workflows/build-binary-packages.yml | 173 ++++++++++++++++++++++++++++ 1 file changed, 173 insertions(+) create mode 100644 .github/workflows/build-binary-packages.yml (limited to '.github/workflows/build-binary-packages.yml') diff --git a/.github/workflows/build-binary-packages.yml b/.github/workflows/build-binary-packages.yml new file mode 100644 index 000000000..e387ae9b1 --- /dev/null +++ b/.github/workflows/build-binary-packages.yml @@ -0,0 +1,173 @@ +name: Build Binary Packages + +on: + workflow_dispatch: + release: + +jobs: + +# --- + + ubuntu: + name: Build Ubuntu package + runs-on: ubuntu-18.04 + # env: + # LC_ALL: C.UTF-8 + + steps: + - uses: actions/checkout@v2 + + - name: Install build tools + run: | + sudo apt update + sudo apt install -y \ + make \ + dpkg-dev \ + debhelper \ + haskell-platform \ + libghc-json-dev \ + python-dev \ + default-jdk \ + libtool-bin + + - name: Build Debian package + run: | + make deb + + - name: Copy package + run: | + cp ../gf_*.deb dist/ + + - name: Upload artifact + uses: actions/upload-artifact@v2 + with: + name: gf-${{ github.sha }}-debian + path: dist/gf_*.deb + if-no-files-found: error + +# --- + + macos: + name: Build macOS package + runs-on: macos-10.15 + strategy: + matrix: + ghc: ["8.6.5"] + cabal: ["2.4"] + + steps: + - uses: actions/checkout@v2 + + - name: Setup Haskell + uses: actions/setup-haskell@v1 + id: setup-haskell-cabal + with: + ghc-version: ${{ matrix.ghc }} + cabal-version: ${{ matrix.cabal }} + + - name: Install build tools + run: | + brew install \ + automake + cabal v1-install alex happy + + - name: Build macOS package + run: | + sudo mkdir -p /Library/Java/Home + sudo ln -s /usr/local/opt/openjdk/include /Library/Java/Home/include + make pkg + + - name: Upload artifact + uses: actions/upload-artifact@v2 + with: + name: gf-${{ github.sha }}-macos + path: dist/gf-*.pkg + if-no-files-found: error + +# --- + + windows: + name: Build Windows package + runs-on: windows-2019 + strategy: + matrix: + ghc: ["8.6.5"] + cabal: ["2.4"] + + steps: + - uses: actions/checkout@v2 + + - name: Setup MSYS2 + uses: msys2/setup-msys2@v2 + with: + install: >- + base-devel + gcc + python-devel + + - name: Prepare dist folder + shell: msys2 {0} + run: | + mkdir /c/tmp-dist + mkdir /c/tmp-dist/c + mkdir /c/tmp-dist/java + mkdir /c/tmp-dist/python + + - name: Build C runtime + shell: msys2 {0} + run: | + cd src/runtime/c + autoreconf -i + ./configure + make + make install + cp /mingw64/bin/libpgf-0.dll /c/tmp-dist/c + cp /mingw64/bin/libgu-0.dll /c/tmp-dist/c + + - name: Build Java bindings + shell: msys2 {0} + run: | + export PATH="${PATH}:/c/Program Files/Java/jdk8u275-b01/bin" + cd src/runtime/java + make \ + JNI_INCLUDES="-I \"/c/Program Files/Java/jdk8u275-b01/include\" -I \"/c/Program Files/Java/jdk8u275-b01/include/win32\" -I \"/mingw64/include\" -D__int64=int64_t" \ + WINDOWS_LDFLAGS="-L\"/mingw64/lib\" -no-undefined" + make install + cp .libs//msys-jpgf-0.dll /c/tmp-dist/java/jpgf.dll + cp jpgf.jar /c/tmp-dist/java + + - name: Build Python bindings + shell: msys2 {0} + env: + EXTRA_INCLUDE_DIRS: /mingw64/include + EXTRA_LIB_DIRS: /mingw64/lib + run: | + cd src/runtime/python + python setup.py build + python setup.py install + cp /usr/lib/python3.8/site-packages/pgf* /c/tmp-dist/python + + - name: Setup Haskell + uses: actions/setup-haskell@v1 + id: setup-haskell-cabal + with: + ghc-version: ${{ matrix.ghc }} + cabal-version: ${{ matrix.cabal }} + + - name: Install Haskell build tools + run: | + cabal install alex happy + + - name: Build GF + run: | + cabal install --only-dependencies -fserver + cabal configure -fserver + cabal build + copy dist\build\gf\gf.exe C:\tmp-dist + + - name: Upload artifact + uses: actions/upload-artifact@v2 + with: + name: gf-${{ github.sha }}-windows + path: C:\tmp-dist\* + if-no-files-found: error -- cgit v1.2.3 From a7a6eb55811a234a46b650b77357f0589ba6a46b Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Mon, 30 Nov 2020 21:34:50 +0100 Subject: Update release instructions --- .github/workflows/build-binary-packages.yml | 2 +- RELEASE.md | 31 +++++++++++++++++------------ 2 files changed, 19 insertions(+), 14 deletions(-) (limited to '.github/workflows/build-binary-packages.yml') diff --git a/.github/workflows/build-binary-packages.yml b/.github/workflows/build-binary-packages.yml index e387ae9b1..e33022e6e 100644 --- a/.github/workflows/build-binary-packages.yml +++ b/.github/workflows/build-binary-packages.yml @@ -41,7 +41,7 @@ jobs: - name: Upload artifact uses: actions/upload-artifact@v2 with: - name: gf-${{ github.sha }}-debian + name: gf-${{ github.sha }}-ubuntu path: dist/gf_*.deb if-no-files-found: error diff --git a/RELEASE.md b/RELEASE.md index 0c304fe51..3a771b78d 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -11,14 +11,14 @@ See the [RGL's RELEASE.md](https://github.com/GrammaticalFramework/gf-rgl/blob/m **Web pages** 1. Create `download/index-X.Y.md` with installation instructions. -1. Create `download/release-X.Y.md` with changelog information. -1. Update `download/index.html` to redirect to the new version. -1. Add announcement in news section in `index.html`. +2. Create `download/release-X.Y.md` with changelog information. +3. Update `download/index.html` to redirect to the new version. +4. Add announcement in news section in `index.html`. **Version numbers** 1. Update version number in `gf.cabal` (ommitting `-git` suffix). -1. Add a new line in `debian/changelog`. +2. Add a new line in `debian/changelog`. ### 2. Create GitHub release @@ -26,25 +26,30 @@ See the [RGL's RELEASE.md](https://github.com/GrammaticalFramework/gf-rgl/blob/m and pushed, check that all CI workflows are successful (fixing as necessary): - - -1. Create a GitHub release [here](https://github.com/GrammaticalFramework/gf-core/releases/new) using tag format `RELEASE-X.Y`. +2. Create a GitHub release [here](https://github.com/GrammaticalFramework/gf-core/releases/new): + - Tag version format `RELEASE-X.Y` + - Title: "GF X.Y" + - Description: mention major changes since last release +3. Publish the release to trigger the building of the binary packages (below). ### 3. Binary packages -The binaries will be built automatically by the GitHub Actions workflows, -but the generated artifacts must be manually attached to the release as _assets_. +The binaries will be built automatically by GitHub Actions when the release is created, +but the generated _artifacts_ must be manually attached to the release as _assets_. -1. Go to . -1. Click "Build [platform] Package" under _Workflows_. -1. Choose the workflow run corresponding to the release commit SHA. -1. Download the artifact locally, then add to the release with a name `gf-X.Y-PLATFORM.EXT` (e.g. `gf-3.11-macos.pkg`). +1. Go to the [actions page](https://github.com/GrammaticalFramework/gf-core/actions) and click "Build Binary Packages" under _Workflows_. +2. Choose the workflow run corresponding to the newly created release. +3. Download the artifacts locally. Extract the Ubuntu and macOS ones to get the `.deb` and `.pkg` files. +4. Go back to the [releases page](https://github.com/GrammaticalFramework/gf-core/releases) and click to edit the release information. +5. Add the downloaded artifacts as release assets, giving them names with format `gf-X.Y-PLATFORM.EXT` (e.g. `gf-3.11-macos.pkg`). ### 4. Upload to Hackage 1. Run `make sdist` -1. Upload the package, either: +2. Upload the package, either: 1. **Manually**: visit and upload the file `dist/gf-X.Y.tar.gz` 2. **via Cabal (≥2.4)**: `cabal upload dist/gf-X.Y.tar.gz` -1. If the documentation-building fails on the Hackage server, do: +3. If the documentation-building fails on the Hackage server, do: ``` cabal v2-haddock --builddir=dist/docs --haddock-for-hackage --enable-doc cabal upload --documentation dist/docs/*-docs.tar.gz -- cgit v1.2.3 From d6be4ec3b0a77782b8287e0801d6ba60e8968c6f Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Mon, 30 Nov 2020 23:05:43 +0100 Subject: Add note about why we're not using Setup Haskell action for Ubuntu build. --- .github/workflows/build-binary-packages.yml | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to '.github/workflows/build-binary-packages.yml') diff --git a/.github/workflows/build-binary-packages.yml b/.github/workflows/build-binary-packages.yml index e33022e6e..810fa1352 100644 --- a/.github/workflows/build-binary-packages.yml +++ b/.github/workflows/build-binary-packages.yml @@ -11,16 +11,28 @@ jobs: ubuntu: name: Build Ubuntu package runs-on: ubuntu-18.04 - # env: - # LC_ALL: C.UTF-8 + # strategy: + # matrix: + # ghc: ["8.6.5"] + # cabal: ["2.4"] steps: - uses: actions/checkout@v2 + # Note: `haskell-platform` is listed as requirement in debian/control, + # which is why it's installed using apt instead of the Setup Haskell action. + + # - name: Setup Haskell + # uses: actions/setup-haskell@v1 + # id: setup-haskell-cabal + # with: + # ghc-version: ${{ matrix.ghc }} + # cabal-version: ${{ matrix.cabal }} + - name: Install build tools run: | - sudo apt update - sudo apt install -y \ + sudo apt-get update + sudo apt-get install -y \ make \ dpkg-dev \ debhelper \ @@ -30,7 +42,7 @@ jobs: default-jdk \ libtool-bin - - name: Build Debian package + - name: Build package run: | make deb @@ -71,7 +83,7 @@ jobs: automake cabal v1-install alex happy - - name: Build macOS package + - name: Build package run: | sudo mkdir -p /Library/Java/Home sudo ln -s /usr/local/opt/openjdk/include /Library/Java/Home/include -- cgit v1.2.3