Skip to content

Commit a08050f

Browse files
authored
Update build process (#3)
Signed-off-by: Tamal Saha <tamal@appscode.com>
1 parent ecae871 commit a08050f

File tree

3,060 files changed

+983869
-114
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,060 files changed

+983869
-114
lines changed

.github/.kodiak.toml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version = 1
2+
3+
[merge]
4+
method = "squash" # default: "merge"
5+
delete_branch_on_merge = true # default: false
6+
optimistic_updates = true # default: true
7+
prioritize_ready_to_merge = true # default: false
8+
9+
[merge.message]
10+
title = "pull_request_title" # default: "github_default"
11+
body = "github_default" # default: "github_default"
12+
strip_html_comments = true # default: false
13+
14+
[update]
15+
always = true # default: false
16+
17+
[approve]
18+
auto_approve_usernames = ["1gtm", "tamalsaha"]

.github/workflows/ci.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- "*"
7+
push:
8+
branches:
9+
- master
10+
workflow_dispatch:
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
build:
18+
name: Build
19+
runs-on: ubuntu-24.04
20+
steps:
21+
- name: Set up Go 1.24
22+
uses: actions/setup-go@v5
23+
with:
24+
go-version: '1.24'
25+
id: go
26+
27+
- name: Use Node.js 20.x
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: '20'
31+
check-latest: true
32+
33+
- name: Check out code into the Go module directory
34+
uses: actions/checkout@v4
35+
36+
- name: Prepare git
37+
env:
38+
GITHUB_USER: 1gtm
39+
GITHUB_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }}
40+
run: |
41+
set -x
42+
git config --global user.name "${GITHUB_USER}"
43+
git config --global user.email "${GITHUB_USER}@appscode.com"
44+
git config --global \
45+
url."https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com".insteadOf \
46+
"https://github.com"
47+
48+
- name: Run checks
49+
run: |
50+
sudo apt-get -qq update || true
51+
make ci

.github/workflows/github-actions.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: release-tracker
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
workflow_dispatch:
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-24.04
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Prepare git
20+
env:
21+
GITHUB_USER: 1gtm
22+
GITHUB_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }}
23+
run: |
24+
git config --global user.name "${GITHUB_USER}"
25+
git config --global user.email "${GITHUB_USER}@appscode.com"
26+
git remote set-url origin https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
27+
28+
- name: Install GitHub CLI
29+
run: |
30+
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1
31+
sudo mv bin/hub /usr/local/bin
32+
33+
- name: Update release tracker
34+
if: |
35+
github.event.action == 'closed' &&
36+
github.event.pull_request.merged == true
37+
env:
38+
GITHUB_USER: 1gtm
39+
GITHUB_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }}
40+
run: |
41+
./hack/scripts/update-release-tracker.sh

.github/workflows/release.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "*.*"
7+
workflow_dispatch:
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
build:
15+
name: Build
16+
runs-on: ubuntu-24.04
17+
steps:
18+
- uses: actions/checkout@v1
19+
20+
- name: Set up Go 1.24
21+
uses: actions/setup-go@v5
22+
with:
23+
go-version: '1.24'
24+
id: go
25+
26+
- name: Prepare git
27+
env:
28+
GITHUB_USER: 1gtm
29+
GITHUB_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }}
30+
run: |
31+
set -x
32+
git config --global user.name "${GITHUB_USER}"
33+
git config --global user.email "${GITHUB_USER}@appscode.com"
34+
git config --global \
35+
url."https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com".insteadOf \
36+
"https://github.com"
37+
38+
- name: Print version info
39+
id: semver
40+
run: |
41+
make version
42+
43+
- name: Set up QEMU
44+
id: qemu
45+
uses: docker/setup-qemu-action@v3
46+
with:
47+
cache-image: false
48+
49+
- name: Set up Docker Buildx
50+
uses: docker/setup-buildx-action@v3
51+
52+
- name: Publish to GitHub Container Registry
53+
env:
54+
REGISTRY: ghcr.io/appscode
55+
DOCKER_TOKEN: ${{ secrets.LGTM_GITHUB_TOKEN }}
56+
USERNAME: 1gtm
57+
APPSCODE_ENV: prod
58+
run: |
59+
docker login ghcr.io --username ${USERNAME} --password ${DOCKER_TOKEN}
60+
make release COMPRESS=yes
61+
62+
- name: Release
63+
uses: softprops/action-gh-release@v1
64+
if: startsWith(github.ref, 'refs/tags/')
65+
with:
66+
files: |
67+
bin/wal-listener-linux-amd64.tar.gz
68+
bin/wal-listener-linux-arm64.tar.gz
69+
bin/wal-listener-checksums.txt
70+
env:
71+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@
1717
# vendor/
1818
config.yml
1919
certs/*
20+
21+
bin
22+
.go

Dockerfile

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

Dockerfile.dbg

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Copyright AppsCode Inc. and Contributors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
FROM ghcr.io/appscode/dlv:1.24
16+
17+
FROM {ARG_FROM}
18+
19+
LABEL org.opencontainers.image.source https://github.com/bytebuilders/wal-listener
20+
21+
RUN set -x \
22+
&& apt-get update \
23+
&& apt-get upgrade -y \
24+
&& apt-get install -y --no-install-recommends ca-certificates openssh-client \
25+
&& rm -rf /var/lib/apt/lists/* /usr/share/doc /usr/share/man /tmp/* \
26+
&& echo 'Etc/UTC' > /etc/timezone
27+
28+
ADD bin/{ARG_BIN}-{ARG_OS}-{ARG_ARCH} /{ARG_BIN}
29+
COPY --from=0 /usr/local/bin/dlv /bin/dlv
30+
31+
EXPOSE 40000
32+
33+
ENTRYPOINT ["/bin/dlv", "--listen=:40000", "--headless=true", "--api-version=2", "exec", "/{ARG_BIN}", "--"]

Dockerfile.in

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Copyright AppsCode Inc. and Contributors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
FROM {ARG_FROM}
16+
17+
LABEL org.opencontainers.image.source https://github.com/bytebuilders/wal-listener
18+
19+
RUN set -x \
20+
&& apk add --update --upgrade --no-cache pcre2 ca-certificates tzdata openssh-client \
21+
&& echo 'Etc/UTC' > /etc/timezone
22+
23+
ADD bin/{ARG_BIN}-{ARG_OS}-{ARG_ARCH} /{ARG_BIN}
24+
25+
USER 65534
26+
27+
ENTRYPOINT ["/{ARG_BIN}"]

0 commit comments

Comments
 (0)