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

[**Added**] Build neo-cli Docker Image #3355

Merged
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
6e47778
Added `devcontrainer` test for `neo-cli`
cschuchardt88 Jun 24, 2024
ddc33da
Basic contrainer setup
cschuchardt88 Jun 24, 2024
c23f15b
Updated version of `checkout` action job's step.
cschuchardt88 Jun 24, 2024
9f62660
Changed to `neo-cli`
cschuchardt88 Jun 24, 2024
1b06cc1
Update `dockerfile`
cschuchardt88 Jun 24, 2024
058d16a
Updated `PostCreateCommand`
cschuchardt88 Jun 24, 2024
6be5733
Changed to `bookworm-slim`
cschuchardt88 Jun 24, 2024
0ce7674
Reverted to `Jammy`
cschuchardt88 Jun 24, 2024
41ad46e
Added `sudo` command for `PostCreateCommand`
cschuchardt88 Jun 24, 2024
66e3b34
Added permissions
cschuchardt88 Jun 24, 2024
5707d39
Removed `screen` command
cschuchardt88 Jun 24, 2024
299973b
Added to `bin` and `PostCreateCommand`
cschuchardt88 Jun 24, 2024
5e54cf1
Changed `devcontainer` files
cschuchardt88 Jun 24, 2024
3ec9f3b
Reverted builds
cschuchardt88 Jun 24, 2024
02f6229
Added `neo` repo to devcontainer
cschuchardt88 Jun 24, 2024
85cf83e
Changed to docker-image for github registry
cschuchardt88 Jun 24, 2024
34cb95f
Fixed Bugs in `docker` support for `neo-cli` image
cschuchardt88 Jun 25, 2024
a07c619
Added type `container`
cschuchardt88 Jun 25, 2024
e3fbfbd
Revert `.devcontainer` folder
cschuchardt88 Jun 25, 2024
48ddb3c
format
cschuchardt88 Jun 25, 2024
57233d2
Changed workflow to `docker` for `pkgs-delete.yml` since we use `v4`
cschuchardt88 Jun 25, 2024
b877de0
Deleted `Dockerfile` from `src\Neo.CLI`
cschuchardt88 Jun 25, 2024
8821807
Merge branch 'master' into add/tests/devcontainer-workflow
cschuchardt88 Jun 26, 2024
b7c941c
Revert "Deleted `Dockerfile` from `src\Neo.CLI`"
cschuchardt88 Jun 26, 2024
5a18caa
Merge branch 'master' into add/tests/devcontainer-workflow
Jim8y Jul 23, 2024
e960297
Merge branch 'master' into add/tests/devcontainer-workflow
cschuchardt88 Jul 23, 2024
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
77 changes: 77 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Publish (docker-image)

on:
release:
types: [published]

env:
DOTNET_VERSION: 8.0.x
DIST_DIR: ./dist

jobs:
neo-cli-build:
runs-on: ubuntu-latest

steps:
- name: Set Application Version (Environment Variable)
run: |
APP_VERSION=$(echo '${{ github.event.release.tag_name }}' | cut -d 'v' -f 2)
echo "APP_VERSION=$APP_VERSION" >> $GITHUB_ENV

- name: Checkout (GitHub)
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Build (neo-cli)
run: |
dotnet publish ./src/Neo.CLI \
--framework net8.0 \
--configuration Release \
--runtime linux-x64 \
--self-contained true \
--output ${{ env.DIST_DIR }} \
--verbosity normal \
-p:VersionPrefix=${{ env.APP_VERSION }} \
-p:RuntimeIdentifier=linux-x64 \
-p:SelfContained=true \
-p:IncludeNativeLibrariesForSelfExtract=false \
-p:PublishTrimmed=false \
-p:PublishSingleFile=true \
-p:PublishReadyToRun=true \
-p:EnableCompressionInSingleFile=true \
-p:DebugType=embedded \
-p:ServerGarbageCollection=true

- name: Build (LevelDbStore)
run: |
dotnet build ./src/Plugins/LevelDBStore \
--framework net8.0 \
--configuration Release \
--output ${{ env.DIST_DIR }}/Plugins/LevelDBStore \
--verbosity normal \
-p:VersionPrefix=${{ env.APP_VERSION }}

- name: Remove (junk)
run: |
rm -v ${{ env.DIST_DIR }}/Plugins/LevelDBStore/Neo*
rm -v ${{ env.DIST_DIR }}/Plugins/LevelDBStore/*.pdb
rm -v ${{ env.DIST_DIR }}/Plugins/LevelDBStore/*.xml
rm -v ${{ env.DIST_DIR }}/*.xml

- name: Docker Login
run: |
docker login ghcr.io \
--username ${{ github.repository_owner }} \
--password ${{ secrets.GITHUB_TOKEN }}

- name: Docker Build
run: |
docker build . \
--file ./.neo/docker/neo-cli/Dockerfile \
--tag ghcr.io/${{ github.repository_owner }}/neo-cli:latest \
--tag ghcr.io/${{ github.repository_owner }}/neo-cli:${{ env.APP_VERSION }} \
--push
13 changes: 12 additions & 1 deletion .github/workflows/pkgs-delete.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,24 @@ jobs:
delete-only-pre-release-versions: "true"
token: "${{ secrets.GITHUB_TOKEN }}"

- name: Delete Neo Package
- name: Delete Neo Package (nuget)
uses: actions/delete-package-versions@v4
with:
package-name: Neo
package-type: nuget
min-versions-to-keep: 3
delete-only-pre-release-versions: "true"
token: "${{ secrets.GITHUB_TOKEN }}"

- name: Delete Neo Package (docker)
uses: actions/delete-package-versions@v4
with:
package-name: Neo
package-type: container
min-versions-to-keep: 1
delete-only-pre-release-versions: "true"
token: "${{ secrets.GITHUB_TOKEN }}"

- name: Delete Neo.ConsoleService Package
uses: actions/delete-package-versions@v4
with:
Expand All @@ -118,6 +128,7 @@ jobs:
min-versions-to-keep: 3
delete-only-pre-release-versions: "true"
token: "${{ secrets.GITHUB_TOKEN }}"

- name: Delete Neo.Extensions Package
uses: actions/delete-package-versions@v4
with:
Expand Down
8 changes: 8 additions & 0 deletions .neo/docker/neo-cli/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM debian:stable-slim

# Install the apt-get packages
RUN apt-get update
RUN apt-get install -y libicu-dev libleveldb-dev screen
cschuchardt88 marked this conversation as resolved.
Show resolved Hide resolved

COPY ./dist /opt/neo-cli
RUN ln -s /opt/neo-cli/neo-cli /usr/bin
Loading