Skip to content

Debian package #3955

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

Merged
merged 10 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
56 changes: 55 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,65 @@ jobs:
- name: Build
run: nix build .#kore-exec .#kore-rpc-booster

ubuntu-package:
name: 'Build Ubuntu package'
needs: draft-release
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v4
with:
submodules: recursive

- name: Cache Stack root
uses: actions/cache@v4
with:
path: ~/.stack
key: stack-${{ runner.os }}-ghc-${{ env.ghc_version }}-${{ hashFiles('stack.yaml') }}-${{ hashFiles('stack.yaml.lock') }}
restore-keys: |
stack-${{ runner.os }}-ghc-${{ env.ghc_version }}-${{ hashFiles('stack.yaml') }}
stack-${{ runner.os }}-ghc-${{ env.ghc_version }}

- uses: haskell-actions/[email protected]
id: setup-haskell-stack
with:
ghc-version: ${{ env.ghc_version }}
stack-version: ${{ env.stack_version }}
enable-stack: true
stack-setup-ghc: true

- name: Build Ubuntu package
run: ./package/debian/build-package jammy k-haskell-backend.deb

- name: 'Upload to release'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -x
VERSION=v$(cat package/version)
cp k-haskell-backend.deb k-haskell-backend_${VERSION}_amd64_ubuntu_jammy.deb
gh release upload ${VERSION} \
--repo runtimeverification/haskell-backend \
--clobber \
k-haskell-backend_${VERSION}_amd64_ubuntu_jammy.deb

- name: 'On failure, delete drafted release'
if: failure()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -x
VERSION=v$(cat package/version)
gh release delete ${VERSION} \
--repo runtimeverification/haskell-backend \
--yes \
--cleanup-tag

update-dependents:
name: 'Publish Release'
runs-on: ubuntu-latest
environment: production
needs: [draft-release, release]
needs: [draft-release, ubuntu-package, release]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ needs.draft-release.outputs.version }}
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ jobs:
steps:
- name: Install prerequisites
run: |
sudo apt install --yes z3 libsecp256k1-dev
sudo apt install --yes debhelper z3 libsecp256k1-dev

- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -230,6 +230,9 @@ jobs:
- name: Run unit tests
run: stack test kore:kore-test hs-backend-booster:unit-tests

- name: Build Ubuntu package
run: ./package/debian/build-package jammy k-haskell-backend.deb

hlint:
name: 'HLint'
needs: formatting
Expand Down
21 changes: 21 additions & 0 deletions package/debian/build-package
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash

set -euxo pipefail

base_distro="$1" ; shift
pkg_name="$1" ; shift

mkdir debian

mv package/debian/changelog debian/changelog
mv package/debian/copyright debian/copyright
mv package/debian/k-haskell-backend-docs.docs debian/k-haskell-backend-docs.docs
mv package/debian/source debian/source

mv package/debian/compat.${base_distro} debian/compat
mv package/debian/control.${base_distro} debian/control
mv package/debian/rules.${base_distro} debian/rules

dpkg-buildpackage

mv ../k-haskell-backend_$(cat package/version)_amd64.deb ${pkg_name}
5 changes: 5 additions & 0 deletions package/debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
k-haskell-backend (0.1.0) unstable; urgency=medium

* Initial release

-- Bruce Collie <[email protected]> Fri, 26 Apr 2024 15:43:00 +0100
1 change: 1 addition & 0 deletions package/debian/compat.jammy
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
10
16 changes: 16 additions & 0 deletions package/debian/control.jammy
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Source: k-haskell-backend
Section: devel
Priority: optional
Maintainer: Bruce Collie <[email protected]>
Build-Depends: debhelper (>=10)
Standards-Version: 3.9.6
Homepage: https://github.com/runtimeverification/haskell-backend

Package: k-haskell-backend
Architecture: any
Section: devel
Priority: optional
Depends: libsecp256k1-dev , z3
Description: K Framework Haskell Backend
The symbolic execution engine powering the K Framework
Homepage: https://github.com/runtimeverification/haskell-backend
34 changes: 34 additions & 0 deletions package/debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: k-haskell-backend
Upstream-Contact: Bruce Collie <[email protected]>
Source: https://github.com/runtimeverification/haskell-backend

Files: *
Copyright: 2018-2024 K Team <[email protected]>
License: BSD-3-Clause

License: BSD-3-Clause
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Empty file.
17 changes: 17 additions & 0 deletions package/debian/rules.jammy
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/make -f

DESTDIR=$(shell pwd)/debian/k-haskell-backend
PREFIX=/usr
export DESTDIR
export PREFIX

%:
dh $@

override_dh_auto_build:
stack build

override_dh_auto_install:
stack install --local-bin-path $(DESTDIR)$(PREFIX)/bin

override_dh_auto_test:
1 change: 1 addition & 0 deletions package/debian/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (native)
1 change: 1 addition & 0 deletions package/version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ version_sub() {
sed -i "s/^version: '.*'$/version: '${version}'/" booster/package.yaml
sed -i "s/^version: .*$/version: ${version}/" kore/kore.cabal
sed -i "s/^version: .*$/version: ${version}/" ./kore-rpc-types/kore-rpc-types.cabal
sed -i 's/^k-haskell-backend (.*) unstable; urgency=medium$/k-haskell-backend ('"$version"') unstable; urgency=medium/' package/debian/changelog
}

version_command="$1" ; shift
Expand Down
Loading