Skip to content

Commit 67def30

Browse files
committed
build: replacing Earthly with Makefile & Docker build/run
1 parent 01de791 commit 67def30

29 files changed

+152
-381
lines changed

.github/renovate.json

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"automerge": true,
77
"dockerfile": {
88
"managerFilePatterns": [
9-
"/(^|/)Earthfile$/",
109
"/(^|/|\\.)Dockerfile$/",
1110
"/(^|/)Dockerfile[^/]*$/"
1211
]
@@ -15,7 +14,8 @@
1514
{
1615
"customType": "regex",
1716
"managerFilePatterns": [
18-
"/^Earthfile$/"
17+
"/(^|/|\\.)Dockerfile$/",
18+
"/(^|/)Dockerfile[^/]*$/"
1919
],
2020
"matchStrings": [
2121
"# renovate: datasource=(?<datasource>.*?) depName=(?<depName>.*?)( versioning=(?<versioning>.*?))?\\s.+_VERSION=\"(?<currentValue>.*?)\"\\s"
@@ -24,29 +24,8 @@
2424
{
2525
"customType": "regex",
2626
"managerFilePatterns": [
27-
"/^[.]github/workflows//"
28-
],
29-
"matchStrings": [
30-
".*version: (?<currentValue>.*?)\\s"
31-
],
32-
"datasourceTemplate": "github-tags",
33-
"depNameTemplate": "earthly/earthly"
34-
},
35-
{
36-
"customType": "regex",
37-
"managerFilePatterns": [
38-
"/^Earthfile$/"
39-
],
40-
"matchStrings": [
41-
"FROM\\s+(?<depName>[\\S]+?):(?<currentValue>[^@\\s]+)(?:@(?<currentDigest>sha256:[a-f0-9]+))?"
42-
],
43-
"versioningTemplate": "regex:^(?<compatibility>[\\S]*\\d+\\.\\d+(?:\\.\\d+)?(?:[\\S]*)?-alpine-?)(?<major>\\d+)\\.(?<minor>\\d+)(?:\\.(?<patch>\\d+))?$",
44-
"datasourceTemplate": "docker"
45-
},
46-
{
47-
"customType": "regex",
48-
"managerFilePatterns": [
49-
"/^Earthfile$/"
27+
"/(^|/|\\.)Dockerfile$/",
28+
"/(^|/)Dockerfile[^/]*$/"
5029
],
5130
"matchStringsStrategy": "recursive",
5231
"matchStrings": [
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Continuous Delivery (CD)
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
publish-binary:
13+
name: Publish Binary
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout code.
17+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
18+
- name: Publish binary.
19+
run: make publish-binary RELEASE="${GITHUB_REF_NAME}"
20+
env:
21+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by GitHub Actions.
22+
publish-crate:
23+
name: Publish Crate
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Checkout code.
27+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
28+
- name: Publish crate.
29+
run: make publish-crate
30+
env:
31+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

.github/workflows/continuous-integration.yml

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ name: Continuous Integration (CI)
22

33
on: pull_request
44

5-
env:
6-
# Forcing Earthly to use colours, to make reading output easier.
7-
FORCE_COLOR: 1
8-
95
jobs:
106
formatting:
117
name: Formatting
@@ -14,50 +10,34 @@ jobs:
1410
matrix:
1511
language: [rust, shell]
1612
steps:
17-
- name: Download Earthly.
18-
uses: earthly/actions-setup@43211c7a0eae5344d6d79fb4aaf209c8f8866203 # v1.0.13
19-
with:
20-
version: v0.8.15
2113
- name: Checkout code.
2214
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2315
- name: Check formatting.
24-
run: earthly --ci +check-${{ matrix.language }}-formatting
16+
run: make check-${{ matrix.language }}-formatting
2517
linting:
2618
name: Linting
2719
runs-on: ubuntu-latest
2820
strategy:
2921
matrix:
30-
language: [rust, shell]
22+
language: [rust]
3123
steps:
32-
- name: Download Earthly.
33-
uses: earthly/actions-setup@43211c7a0eae5344d6d79fb4aaf209c8f8866203 # v1.0.13
34-
with:
35-
version: v0.8.15
3624
- name: Checkout code.
3725
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3826
- name: Check linting.
39-
run: earthly --ci +check-${{ matrix.language }}-linting
27+
run: make check-${{ matrix.language }}-linting
4028
compile:
4129
name: Compile
4230
runs-on: ubuntu-latest
4331
steps:
44-
- name: Download Earthly.
45-
uses: earthly/actions-setup@43211c7a0eae5344d6d79fb4aaf209c8f8866203 # v1.0.13
46-
with:
47-
version: v0.8.15
4832
- name: Checkout code.
4933
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
5034
- name: Compile.
51-
run: earthly --ci +compile
35+
run: make compile
5236
unit-test:
5337
name: Unit Test
5438
runs-on: ubuntu-latest
5539
steps:
56-
- name: Download Earthly.
57-
uses: earthly/actions-setup@43211c7a0eae5344d6d79fb4aaf209c8f8866203 # v1.0.13
58-
with:
59-
version: v0.8.15
6040
- name: Checkout code.
6141
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
6242
- name: Unit test.
63-
run: earthly --ci +unit-test
43+
run: make unit-test

.github/workflows/conventional-commits.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,15 @@ name: Conventional Commits
22

33
on: pull_request
44

5-
env:
6-
# Forcing Earthly to use colours, to make reading output easier.
7-
FORCE_COLOR: 1
8-
95
jobs:
106
linting:
117
name: Linting
128
runs-on: ubuntu-latest
139
steps:
14-
- name: Download Earthly.
15-
uses: earthly/actions-setup@43211c7a0eae5344d6d79fb4aaf209c8f8866203 # v1.0.13
16-
with:
17-
version: v0.8.15
1810
- name: Checkout code.
1911
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2012
with:
2113
ref: ${{ github.event.pull_request.head.sha }}
2214
fetch-depth: 0
2315
- name: Check Conventional Commits linting.
24-
run: earthly --ci +check-conventional-commits-linting --from_reference "origin/${{ github.base_ref }}"
16+
run: make check-conventional-commits-linting FROM="origin/${{ github.base_ref }}"

.github/workflows/git-history.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,15 @@ name: Git History
22

33
on: pull_request
44

5-
env:
6-
# Forcing Earthly to use colours, to make reading output easier.
7-
FORCE_COLOR: 1
8-
95
jobs:
106
clean:
117
name: Clean
128
runs-on: ubuntu-latest
139
steps:
14-
- name: Download Earthly.
15-
uses: earthly/actions-setup@43211c7a0eae5344d6d79fb4aaf209c8f8866203 # v1.0.13
16-
with:
17-
version: v0.8.15
1810
- name: Checkout code.
1911
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2012
with:
2113
ref: ${{ github.event.pull_request.head.sha }}
2214
fetch-depth: 0
2315
- name: Check clean Git history.
24-
run: earthly --ci +check-clean-git-history --from "origin/${{ github.base_ref }}"
16+
run: make check-clean-git-history FROM="origin/${{ github.base_ref }}"

.github/workflows/github-actions-workflows.yml

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,20 @@ name: GitHub Actions Workflows
22

33
on: pull_request
44

5-
env:
6-
# Forcing Earthly to use colours, to make reading output easier.
7-
FORCE_COLOR: 1
8-
95
jobs:
106
linting:
117
name: Linting
128
runs-on: ubuntu-latest
139
steps:
14-
- name: Download Earthly.
15-
uses: earthly/actions-setup@43211c7a0eae5344d6d79fb4aaf209c8f8866203 # v1.0.13
16-
with:
17-
version: v0.8.15
1810
- name: Checkout code.
1911
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2012
- name: Check GitHub Actions workflows linting.
21-
run: earthly +check-github-actions-workflows-linting
13+
run: make check-github-actions-workflows-linting
2214
formatting:
2315
name: Formatting
2416
runs-on: ubuntu-latest
2517
steps:
26-
- name: Download Earthly.
27-
uses: earthly/actions-setup@43211c7a0eae5344d6d79fb4aaf209c8f8866203 # v1.0.13
28-
with:
29-
version: v0.8.15
3018
- name: Checkout code.
3119
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3220
- name: Check formatting.
33-
run: earthly +check-yaml-formatting
21+
run: make check-yaml-formatting

.github/workflows/mirroring.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ jobs:
1212
- name: Checkout code.
1313
run: git clone --mirror "https://github.com/${GITHUB_REPOSITORY}.git" "${GITHUB_WORKSPACE}"
1414
- name: Get GitLab repository.
15-
run: echo "REPOSITORY_NAME=$(echo "${GITHUB_REPOSITORY}" | sed "s|^${GITHUB_REPOSITORY_OWNER}/||g")" >> "${GITHUB_ENV}"
15+
run: echo "REPOSITORY_NAME=${GITHUB_REPOSITORY/${GITHUB_REPOSITORY_OWNER}/}" >> "${GITHUB_ENV}"
1616
- name: Mirroring.
1717
run: git push --mirror "https://oauth2:${{ secrets.GITLAB_PERSONAL_ACCESS_TOKEN }}@gitlab.com/DeveloperC/${REPOSITORY_NAME}"

0 commit comments

Comments
 (0)