Skip to content

Commit 163571d

Browse files
TMP CI
1 parent 5800056 commit 163571d

File tree

3 files changed

+11
-60
lines changed

3 files changed

+11
-60
lines changed

.github/workflows/publish.yml

Lines changed: 9 additions & 58 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,15 +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 }}
70+
tags: ${{ env.IMAGE }}:${{ github.sha }},${{ env.IMAGE }}:latest
11871
labels: ${{ steps.meta.outputs.labels }}
119-
push: false
72+
push: true
12073

12174
builder:
12275
name: App Builder
12376
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, 'full/Dockerfile')))
77+
needs: [mods_list, builder_lite]
12678
permissions:
12779
packages: write
12880

@@ -158,15 +110,14 @@ jobs:
158110
with:
159111
file: full/Dockerfile
160112
platforms: ${{ env.BUILD_PLATFORMS }}
161-
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
162114
labels: ${{ steps.meta.outputs.labels }}
163-
push: false
115+
push: true
164116

165117
dev_tools:
166118
name: App Developer Tools
167119
runs-on: ubuntu-latest
168-
needs: [mods_list, check_changelog, builder]
169-
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]
170121
permissions:
171122
packages: write
172123

@@ -202,6 +153,6 @@ jobs:
202153
with:
203154
file: dev-tools/Dockerfile
204155
platforms: ${{ env.BUILD_PLATFORMS }}
205-
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
206157
labels: ${{ steps.meta.outputs.labels }}
207-
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)