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 release action #49

Merged
merged 5 commits into from
Aug 15, 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
35 changes: 35 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# stub from https://github.com/softprops/action-gh-release
name: Release
on:
push:
tags:
- "v*.*.*"

jobs:
build-and-release:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Build image
run: docker build .

- name: Compile
run: |
mkdir build \
&& docker run \
-v ./build:/root/scheme-langserver/build/ \
$(docker build -q .) \
bash -c 'source .akku/bin/activate
compile-chez-program run.ss
mv run build/run || exit 1
'

- name: Release
uses: softprops/action-gh-release@v2
with:
repo: konst-aa/scheme-langserver
files: build/run

14 changes: 10 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,16 @@ on:
branches: main

jobs:
build-and-deploy:
build-and-test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Build and test
run: docker run $(docker build -q .)
- name: Checkout
uses: actions/checkout@v3

- name: Build image
run: docker build .

- name: Test
run: docker run $(docker build -q .) ./test.sh

49 changes: 36 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM alpine:latest as build-chez
# Install chez
FROM debian:bullseye AS build-chez

RUN apk update && apk --no-cache --update add \
gcc git make musl-dev curl \
ncurses ncurses-dev util-linux-dev
RUN apt-get update && apt-get install -y \
curl build-essential git uuid-dev make ncurses-dev

WORKDIR /root/
RUN curl -L https://github.com/cisco/ChezScheme/releases/download/v9.6.4/csv9.6.4.tar.gz | tar -zx
Expand All @@ -12,16 +12,20 @@ WORKDIR /root/ChezScheme
RUN ./configure --threads --disable-x11
RUN make && make install

WORKDIR /root/
RUN git clone https://github.com/gwatt/chez-exe.git

WORKDIR /root/chez-exe/

FROM akkuscm/akku
RUN apk update && apk --no-cache --update add bash
RUN /usr/bin/scheme --script gen-config.ss --bootpath /usr/lib/csv9.6.4/ta6le
RUN make install

# Ensure that there are no collisions
RUN rm -rf /usr/lib/csv9.6.4/

COPY --from=build-chez /usr/bin/scheme /usr/bin/
COPY --from=build-chez /usr/lib/csv9.6.4/ /usr/lib/csv9.6.4/

# Install project with akku (in Alpine)
FROM akkuscm/akku AS akku-install
RUN apk update && apk --no-cache --update add \
bash

RUN mkdir /root/scheme-langserver/
WORKDIR /root/scheme-langserver/
Expand All @@ -37,10 +41,29 @@ COPY virtual-file-system /root/scheme-langserver/virtual-file-system/
COPY analysis /root/scheme-langserver/analysis/
COPY tests /root/scheme-langserver/tests/

COPY scheme-langserver.sls output-type-analysis.ss test.sh run.ss /root/scheme-langserver/
COPY scheme-langserver.sls output-type-analysis.ss test.sh run.ss build.sh /root/scheme-langserver/

# Install project
RUN akku install


ENTRYPOINT [ "./test.sh" ]

# Put it all together in Debian
FROM debian:bullseye

ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y git make build-essential uuid-dev

# add chez scheme
COPY --from=build-chez /usr/bin/scheme /usr/bin/
COPY --from=build-chez /usr/lib/csv9.6.4/ /usr/lib/csv9.6.4/

# add compile-chez-program
COPY --from=build-chez /usr/local/bin/compile-chez-program /usr/local/bin/
COPY --from=build-chez /usr/local/lib/full-chez.a /usr/local/lib/
COPY --from=build-chez /usr/local/lib/petite-chez.a /usr/local/lib/

# add project
COPY --from=akku-install /root/scheme-langserver/ /root/scheme-langserver/

WORKDIR /root/scheme-langserver/

Loading