Skip to content

Commit 27be777

Browse files
TMP CI
1 parent 836de57 commit 27be777

File tree

3 files changed

+11
-97
lines changed

3 files changed

+11
-97
lines changed

.github/workflows/publish.yml

Lines changed: 9 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -13,52 +13,6 @@ env:
1313
BUILD_PLATFORMS: linux/amd64,linux/arm64
1414

1515
jobs:
16-
check_changelog:
17-
name: Check changelog versions
18-
runs-on: ubuntu-latest
19-
steps:
20-
- name: Clone
21-
uses: actions/checkout@v3
22-
23-
- name: Get current version
24-
id: get-current-version
25-
run: |
26-
echo "current_version=$(grep -Po '(?<=## \[)(\d+\.)+[^\]]' CHANGELOG.md | head -n 1)" >> "$GITHUB_OUTPUT"
27-
28-
- name: Login to registry
29-
uses: docker/login-action@v2
30-
with:
31-
registry: ${{ env.REGISTRY }}
32-
username: ${{ github.actor }}
33-
password: ${{ secrets.GITHUB_TOKEN }}
34-
35-
- name: Check already existing image
36-
run: |
37-
GHCR_TOKEN=$(echo ${{ secrets.GITHUB_TOKEN }} | base64)
38-
39-
# Get tags of all images from GHCR
40-
TAGS_FULL=$(curl -H "Authorization: Bearer ${GHCR_TOKEN}" https://ghcr.io/v2/${REPO_PATH,,}/${REPO_NAME,,}/tags/list)
41-
TAGS_LITE=$(curl -H "Authorization: Bearer ${GHCR_TOKEN}" https://ghcr.io/v2/${REPO_PATH,,}/${REPO_NAME,,}-lite/tags/list)
42-
TAGS_LEGACY=$(curl -H "Authorization: Bearer ${GHCR_TOKEN}" https://ghcr.io/v2/${REPO_PATH,,}/${REPO_NAME,,}-legacy/tags/list)
43-
TAGS_DEV_TOOLS=$(curl -H "Authorization: Bearer ${GHCR_TOKEN}" https://ghcr.io/v2/${REPO_PATH,,}/ledger-app-dev-tools/tags/list)
44-
45-
# Concatenate all tags from json fields in one string without brackets
46-
ALL_TAGS=$(echo $TAGS_FULL $TAGS_LITE $TAGS_LEGACY $TAGS_DEV_TOOLS | jq -s '.[0].tags + .[1].tags + .[2].tags + .[3].tags' | tr -d '[]')
47-
48-
# Get the tag to find
49-
TAG_TO_FIND=${{ steps.get-current-version.outputs.current_version }}
50-
51-
# Check if the tag to find is already present in the list of tags
52-
if [[ "$ALL_TAGS" == *"$TAG_TO_FIND"* ]]; then
53-
echo "An image tagged with the latest changelog version already exists on GHCR. Please update the changelog."
54-
exit 1
55-
else
56-
exit 0
57-
fi
58-
outputs:
59-
current_version: ${{ steps.get-current-version.outputs.current_version }}
60-
61-
6216
mods_list:
6317
name: Get modified files
6418
runs-on: ubuntu-latest
@@ -77,8 +31,7 @@ jobs:
7731
builder_lite:
7832
name: App Builder Lite
7933
runs-on: ubuntu-latest
80-
needs: [mods_list, check_changelog]
81-
if: needs.check_changelog.result == 'success' && contains(needs.mods_list.outputs.modified_files, 'lite/Dockerfile')
34+
needs: [mods_list]
8235
permissions:
8336
packages: write
8437

@@ -114,52 +67,14 @@ jobs:
11467
with:
11568
file: lite/Dockerfile
11669
platforms: ${{ env.BUILD_PLATFORMS }}
117-
tags: ${{ env.IMAGE }}:${{ github.sha }},${{ env.IMAGE }}:latest,${{ env.IMAGE }}:${{ needs.check_changelog.outputs.current_version }}
118-
labels: ${{ steps.meta.outputs.labels }}
119-
push: false
120-
121-
builder_legacy:
122-
name: App Builder Legacy
123-
runs-on: ubuntu-latest
124-
needs: [mods_list, check_changelog, builder_lite]
125-
if: always() && needs.check_changelog.result == 'success' && (needs.builder_lite.result == 'success' || (needs.builder_lite.result == 'skipped' && contains(needs.mods_list.outputs.modified_files, 'legacy/Dockerfile')))
126-
permissions:
127-
packages: write
128-
129-
steps:
130-
- name: Clone
131-
uses: actions/checkout@v3
132-
133-
- name: Login to registry
134-
uses: docker/login-action@v2
135-
with:
136-
registry: ${{ env.REGISTRY }}
137-
username: ${{ github.actor }}
138-
password: ${{ secrets.GITHUB_TOKEN }}
139-
140-
- name: Make full image name
141-
run: |
142-
echo "IMAGE=${REGISTRY}/${REPO_PATH,,}/${REPO_NAME,,}-legacy" >>${GITHUB_ENV}
143-
144-
- name: Extract metadata
145-
id: meta
146-
uses: docker/metadata-action@v4
147-
with:
148-
images: ${{ env.IMAGE }}
149-
150-
- name: Build and push container
151-
uses: docker/build-push-action@v3
152-
with:
153-
file: legacy/Dockerfile
154-
tags: ${{ env.IMAGE }}:${{ github.sha }},${{ env.IMAGE }}:latest,${{ env.IMAGE }}:${{ needs.check_changelog.outputs.current_version }}
70+
tags: ${{ env.IMAGE }}:${{ github.sha }},${{ env.IMAGE }}:latest
15571
labels: ${{ steps.meta.outputs.labels }}
156-
push: false
72+
push: true
15773

15874
builder:
15975
name: App Builder
16076
runs-on: ubuntu-latest
161-
needs: [mods_list, check_changelog, builder_lite]
162-
if: always() && needs.check_changelog.result == 'success' && (needs.builder_lite.result == 'success' || (needs.builder_lite.result == 'skipped' && contains(needs.mods_list.outputs.modified_files, 'full/Dockerfile')))
77+
needs: [mods_list, builder_lite]
16378
permissions:
16479
packages: write
16580

@@ -195,15 +110,14 @@ jobs:
195110
with:
196111
file: full/Dockerfile
197112
platforms: ${{ env.BUILD_PLATFORMS }}
198-
tags: ${{ env.IMAGE }}:${{ github.sha }},${{ env.IMAGE }}:latest,${{ env.IMAGE }}:${{ needs.check_changelog.outputs.current_version }}
113+
tags: ${{ env.IMAGE }}:${{ github.sha }},${{ env.IMAGE }}:latest
199114
labels: ${{ steps.meta.outputs.labels }}
200-
push: false
115+
push: true
201116

202117
dev_tools:
203118
name: App Developer Tools
204119
runs-on: ubuntu-latest
205-
needs: [mods_list, check_changelog, builder]
206-
if: always() && needs.check_changelog.result == 'success' && (needs.builder.result == 'success' || (needs.builder.result == 'skipped' && contains(needs.mods_list.outputs.modified_files, 'dev-tools/Dockerfile')))
120+
needs: [mods_list, builder]
207121
permissions:
208122
packages: write
209123

@@ -239,6 +153,6 @@ jobs:
239153
with:
240154
file: dev-tools/Dockerfile
241155
platforms: ${{ env.BUILD_PLATFORMS }}
242-
tags: ${{ env.IMAGE }}:${{ github.sha }},${{ env.IMAGE }}:latest,${{ env.IMAGE }}:${{ needs.check_changelog.outputs.current_version }}
156+
tags: ${{ env.IMAGE }}:${{ github.sha }},${{ env.IMAGE }}:latest
243157
labels: ${{ steps.meta.outputs.labels }}
244-
push: false
158+
push: true

dev-tools/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest
1+
FROM ghcr.io/apaillier-ledger/ledger-app-builder/ledger-app-builder:latest
22

33
RUN apt install -y --no-install-recommends \
44
imagemagick \

full/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-lite:latest
1+
FROM ghcr.io/apaillier-ledger/ledger-app-builder/ledger-app-builder-lite:latest
22

33
ENV RUST_STABLE=1.83.0
44
ENV RUST_NIGHTLY=nightly-2024-12-01

0 commit comments

Comments
 (0)