Skip to content

Commit d74d3ec

Browse files
Improve Setup and README (#2)
1 parent e3fd58a commit d74d3ec

File tree

10 files changed

+242
-212
lines changed

10 files changed

+242
-212
lines changed

.github/release-drafter.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

.github/workflows/build-and-test.yml

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
#
2-
# This source file is part of the Jass open source project
31
#
4-
# SPDX-FileCopyrightText: 2019-2021 Paul Schmiedmayer and the project authors (see CONTRIBUTORS.md) <paul.schmiedmayer@tum.de>
2+
# This source file is part of the JASS 2021 open source project
3+
#
4+
# SPDX-FileCopyrightText: 2021 Paul Schmiedmayer and the project authors (see CONTRIBUTORS.md) <paul.schmiedmayer@tum.de>
55
#
66
# SPDX-License-Identifier: MIT
77
#
@@ -38,12 +38,8 @@ jobs:
3838
run: xcodebuild -version
3939
- name: Check Swift version
4040
run: swift --version
41-
- name: Release Build # Ensuring release build runs successfully without -enable-testing flag
42-
if: matrix.configuration == 'release'
43-
run: swift build -c release
44-
- name: Debug Build
45-
if: matrix.configuration == 'debug'
46-
run: swift build -c debug
41+
- name: Build ${{ matrix.configuration }}
42+
run: swift build -c ${{ matrix.configuration }}
4743

4844
linux:
4945
name: Linux ${{ matrix.linux }} ${{ matrix.configuration }}
@@ -53,8 +49,8 @@ jobs:
5349
strategy:
5450
fail-fast: false
5551
matrix:
56-
linux: [bionic, focal, amazonlinux2, centos8]
57-
configuration: [debug, release, release_testing]
52+
linux: [focal, amazonlinux2, centos8]
53+
configuration: [debug, release]
5854
steps:
5955
- uses: actions/checkout@v2
6056
- name: Install libsqlite3, lsof, zsh and libavahi-compat-libdnssd-dev
@@ -75,6 +71,5 @@ jobs:
7571
key: ${{ runner.os }}-${{matrix.linux}}-${{matrix.configuration}}-spm2-${{ hashFiles('Package.resolved') }}
7672
- name: Check Swift version
7773
run: swift --version
78-
- name: Release Build # Ensuring release build runs successfully without -enable-testing flag
79-
if: matrix.configuration == 'release'
80-
run: swift build -c release
74+
- name: Build ${{ matrix.configuration }}
75+
run: swift build -c ${{ matrix.configuration }}

.github/workflows/docker.yml

Lines changed: 60 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# This source file is part of the Apodini Template open source project
2+
# This source file is part of the JASS 2021 open source project
33
#
44
# SPDX-FileCopyrightText: 2021 Paul Schmiedmayer and the project authors (see CONTRIBUTORS.md) <paul.schmiedmayer@tum.de>
55
#
@@ -14,9 +14,9 @@ on:
1414
workflow_dispatch:
1515

1616
jobs:
17-
docker:
18-
name: Docker Build and Push Image ${{ matrix.architecture }}
19-
runs-on: ubuntu-latest
17+
dockerARM64:
18+
name: Docker Build and Push Image ARM64
19+
runs-on: ARM64
2020
steps:
2121
- name: Checkout repository
2222
uses: actions/checkout@v2
@@ -25,14 +25,33 @@ jobs:
2525
uses: WyriHaximus/github-action-get-previous-tag@v1
2626
with:
2727
fallback: latest
28-
- name: Set up QEMU
29-
uses: docker/setup-qemu-action@v1
28+
- name: Log in to the container registry
29+
uses: docker/login-action@v1
30+
with:
31+
registry: ghcr.io
32+
username: ${{ github.actor }}
33+
password: ${{ secrets.GITHUB_TOKEN }}
34+
- name: Build and push docker image
35+
id: buildandpush
36+
uses: docker/build-push-action@v2
3037
with:
31-
platforms: linux/arm64
32-
- name: Set up docker buildx
33-
uses: docker/setup-buildx-action@v1
38+
context: .
39+
file: ./Dockerfile
40+
build-args: |
41+
baseimage=swiftarm/swift:5.5.1-ubuntu-focal
42+
push: true
43+
tags: ghcr.io/jass-2021/jass2021-webservice:latest-arm64,ghcr.io/jass-2021/jass2021-webservice:${{ steps.latesttag.outputs.tag }}-arm64
44+
dockerAMD64:
45+
name: Docker Build and Push Image AMD64
46+
runs-on: ubuntu-latest
47+
steps:
48+
- name: Checkout repository
49+
uses: actions/checkout@v2
50+
- name: Get latest tag
51+
id: latesttag
52+
uses: WyriHaximus/github-action-get-previous-tag@v1
3453
with:
35-
install: true
54+
fallback: latest
3655
- name: Log in to the container registry
3756
uses: docker/login-action@v1
3857
with:
@@ -45,93 +64,35 @@ jobs:
4564
with:
4665
context: .
4766
file: ./Dockerfile
67+
build-args: |
68+
baseimage=swift:focal
4869
push: true
49-
platforms: linux/arm64
50-
tags: ghcr.io/jass-2021/jass2021-webservice:latest
51-
- name: Image digest
52-
run: echo ${{ steps.buildandpush.outputs.digest }}
53-
54-
#name: Build Docker Image
55-
#
56-
#on:
57-
# release:
58-
# types: [published]
59-
# workflow_dispatch:
60-
#
61-
#jobs:
62-
# docker:
63-
# name: Docker Build and Push Image ${{ matrix.architecture }}
64-
# runs-on: ubuntu-latest
65-
# strategy:
66-
# matrix:
67-
# architecture: [arm64, amd64]
68-
# steps:
69-
# - name: Checkout repository
70-
# uses: actions/checkout@v2
71-
# - name: Get latest tag
72-
# id: latesttag
73-
# uses: WyriHaximus/github-action-get-previous-tag@v1
74-
# with:
75-
# fallback: latest
76-
# - name: Set up QEMU
77-
# uses: docker/setup-qemu-action@v1
78-
# with:
79-
# platforms: linux/${{ matrix.architecture }}
80-
# - name: Set up docker buildx
81-
# uses: docker/setup-buildx-action@v1
82-
# with:
83-
# install: true
84-
# - name: Log in to the container registry
85-
# uses: docker/login-action@v1
86-
# with:
87-
# registry: ghcr.io
88-
# username: ${{ github.actor }}
89-
# password: ${{ secrets.GITHUB_TOKEN }}
90-
# - name: Determine Base Image
91-
# uses: haya14busa/action-cond@v1
92-
# id: baseimage
93-
# with:
94-
# cond: ${{ matrix.architecture == 'arm64' }}
95-
# if_true: 'swiftarm/swift:5.5.1-ubuntu-focal'
96-
# if_false: 'swift:focal'
97-
# - name: Build and push docker image
98-
# id: buildandpush
99-
# uses: docker/build-push-action@v2
100-
# with:
101-
# context: .
102-
# file: ./Dockerfile
103-
# build-args: |
104-
# baseimage=${{ steps.baseimage.outputs.value }}
105-
# push: true
106-
# platforms: linux/${{ matrix.architecture }}
107-
# tags: ghcr.io/jass-2021/jass2021-webservice:latest-${{ matrix.architecture }},ghcr.io/jass-2021/jass2021-webservice:${{ steps.latesttag.outputs.tag }}-${{ matrix.architecture }}
108-
# - name: Image digest
109-
# run: echo ${{ steps.buildandpush.outputs.digest }}
110-
# dockermanifest:
111-
# needs: [docker]
112-
# name: Create Multi-CPU Architecture Image
113-
# runs-on: ubuntu-latest
114-
# steps:
115-
# - name: Checkout repository
116-
# uses: actions/checkout@v2
117-
# - name: Get latest tag
118-
# id: latesttag
119-
# uses: WyriHaximus/github-action-get-previous-tag@v1
120-
# with:
121-
# fallback: latest
122-
# - name: Log in to the container registry
123-
# uses: docker/login-action@v1
124-
# with:
125-
# registry: ghcr.io
126-
# username: ${{ github.actor }}
127-
# password: ${{ secrets.GITHUB_TOKEN }}
128-
# - name: Create and Push Multi Architecture Image
129-
# run: |
130-
# docker manifest create ghcr.io/jass-2021/jass2021-webservice:latest \
131-
# --amend ghcr.io/jass-2021/jass2021-webservice:latest-amd64 \
132-
# --amend ghcr.io/jass-2021/jass2021-webservice:latest-arm64
133-
# docker manifest create ghcr.io/jass-2021/jass2021-webservice:${{ steps.latesttag.outputs.tag }} \
134-
# --amend ghcr.io/jass-2021/jass2021-webservice:${{ steps.latesttag.outputs.tag }}-amd64 \
135-
# --amend ghcr.io/jass-2021/jass2021-webservice:${{ steps.latesttag.outputs.tag }}-arm64
136-
# docker manifest push ghcr.io/jass-2021/jass2021-webservice:latest
137-
# docker manifest push ghcr.io/jass-2021/jass2021-webservice:${{ steps.latesttag.outputs.tag }}
70+
tags: ghcr.io/jass-2021/jass2021-webservice:latest-amd64,ghcr.io/jass-2021/jass2021-webservice:${{ steps.latesttag.outputs.tag }}-amd64
71+
dockermanifest:
72+
needs: [dockerARM64, dockerAMD64]
73+
name: Create Multi-CPU Architecture Image
74+
runs-on: ubuntu-latest
75+
steps:
76+
- name: Checkout repository
77+
uses: actions/checkout@v2
78+
- name: Get latest tag
79+
id: latesttag
80+
uses: WyriHaximus/github-action-get-previous-tag@v1
81+
with:
82+
fallback: latest
83+
- name: Log in to the container registry
84+
uses: docker/login-action@v1
85+
with:
86+
registry: ghcr.io
87+
username: ${{ github.actor }}
88+
password: ${{ secrets.GITHUB_TOKEN }}
89+
- name: Create and Push Multi Architecture Image
90+
run: |
91+
docker manifest create ghcr.io/jass-2021/jass2021-webservice:latest \
92+
--amend ghcr.io/jass-2021/jass2021-webservice:latest-amd64 \
93+
--amend ghcr.io/jass-2021/jass2021-webservice:latest-arm64
94+
docker manifest create ghcr.io/jass-2021/jass2021-webservice:${{ steps.latesttag.outputs.tag }} \
95+
--amend ghcr.io/jass-2021/jass2021-webservice:${{ steps.latesttag.outputs.tag }}-amd64 \
96+
--amend ghcr.io/jass-2021/jass2021-webservice:${{ steps.latesttag.outputs.tag }}-arm64
97+
docker manifest push ghcr.io/jass-2021/jass2021-webservice:latest
98+
docker manifest push ghcr.io/jass-2021/jass2021-webservice:${{ steps.latesttag.outputs.tag }}

.github/workflows/release.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.github/workflows/spm-update.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
2-
# This source file is part of the Jass open source project
2+
# This source file is part of the JASS 2021 open source project
33
#
4-
# SPDX-FileCopyrightText: 2019-2021 Paul Schmiedmayer and the Jass project authors (see CONTRIBUTORS.md) <paul.schmiedmayer@tum.de>
4+
# SPDX-FileCopyrightText: 2021 Paul Schmiedmayer and the project authors (see CONTRIBUTORS.md) <paul.schmiedmayer@tum.de>
55
#
66
# SPDX-License-Identifier: MIT
77
#

.github/workflows/swiftlint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#
2-
# This source file is part of the Jass open source project
2+
# This source file is part of the JASS 2021 open source project
33
#
4-
# SPDX-FileCopyrightText: 2019-2021 Paul Schmiedmayer and the Jass project authors (see CONTRIBUTORS.md) <paul.schmiedmayer@tum.de>
4+
# SPDX-FileCopyrightText: 2021 Paul Schmiedmayer and the project authors (see CONTRIBUTORS.md) <paul.schmiedmayer@tum.de>
55
#
66
# SPDX-License-Identifier: MIT
77
#

Dockerfile

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,12 @@
77
# SPDX-License-Identifier: MIT
88
#
99

10-
# ARG baseimage=swift:focal
10+
ARG baseimage=swift:focal
1111

1212
# ================================
1313
# Build image
1414
# ================================
15-
# FROM swiftlang/swift:nightly-focal as build
16-
# FROM ghcr.io/apodini/swift@sha256:53b4295f95dc1eafcbc2e03c5dee41839e9652ca31397b9feb4d8903fe1b54ea as build
17-
FROM swiftarm/swift:5.5.1-ubuntu-focal as build
18-
# FROM ${baseimage} as build
15+
FROM ${baseimage} as build
1916

2017
# Install OS updates and, if needed, sqlite3
2118
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \
@@ -40,10 +37,7 @@ RUN cp "$(swift build --package-path /build -c debug --show-bin-path)/DemoWebSer
4037
# ================================
4138
# Run image
4239
# ================================
43-
#
44-
# FROM ghcr.io/apodini/swift@sha256:53b4295f95dc1eafcbc2e03c5dee41839e9652ca31397b9feb4d8903fe1b54ea as run
45-
# FROM swiftlang/swift:nightly-focal as run
46-
FROM swiftarm/swift:5.5.1-ubuntu-focal as run
40+
FROM ${baseimage}-slim as run
4741

4842
# Make sure all system packages are up to date.
4943
RUN export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true \

0 commit comments

Comments
 (0)