Skip to content

Commit 0a07d37

Browse files
feat: use gh for auth
1 parent ecd311a commit 0a07d37

4 files changed

Lines changed: 34 additions & 16 deletions

File tree

.github/workflows/release-codon.yaml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -54,26 +54,27 @@ jobs:
5454
uses: docker/build-push-action@v5
5555
with:
5656
context: release
57+
secrets: |
58+
"github_token=${{ secrets.GH_TOKEN }}"
5759
file: release/codon/Dockerfile
5860
push: true
59-
load: true
6061
build-args: |
6162
VERSION=${{ env.VERSION }}
6263
tags: "${{ env.IMAGE_BASE }}:${{ env.VERSION }}"
6364
cache-from: type=registry,ref=ghcr.io/marcelkottmann/armembeddon/tools-base-codon:buildcache
6465
cache-to: type=registry,ref=ghcr.io/marcelkottmann/armembeddon/tools-base-codon:buildcache,mode=max
6566

66-
- name: Extract Build Artifacts to Host
67-
# Use docker run with --rm (auto-cleanup) and a volume mount (-v)
68-
run: |
69-
docker run --rm \
70-
-v ${{ github.workspace }}/artifact-mount:/release \
71-
${{ env.IMAGE_BASE }}:${{ env.VERSION }} \
72-
sh -c "cp armembeddon.tar.gz /release/"
67+
# - name: Extract Build Artifacts to Host
68+
# # Use docker run with --rm (auto-cleanup) and a volume mount (-v)
69+
# run: |
70+
# docker run --rm \
71+
# -v ${{ github.workspace }}/artifact-mount:/release \
72+
# ${{ env.IMAGE_BASE }}:${{ env.VERSION }} \
73+
# sh -c "cp armembeddon.tar.gz /release/"
7374

74-
- name: Upload Artifacts
75-
uses: actions/upload-artifact@v4
76-
with:
77-
name: codon-build-artifacts-${{ env.VERSION }}
78-
path: ${{ github.workspace }}/artifact-mount/
79-
retention-days: 7
75+
# - name: Upload Artifacts
76+
# uses: actions/upload-artifact@v4
77+
# with:
78+
# name: codon-build-artifacts-${{ env.VERSION }}
79+
# path: ${{ github.workspace }}/artifact-mount/
80+
# retention-days: 7

pr.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
gh api user

release/codon/Dockerfile

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,16 @@ RUN cd codon && cmake -S . -B build \
2121
RUN cd codon && cmake --build build --config Release
2222
RUN cd codon && cmake --install build --prefix=install
2323

24+
# install gh cli
25+
RUN (type -p wget >/dev/null || (apt update && apt install wget -y)) \
26+
&& mkdir -p -m 755 /etc/apt/keyrings \
27+
&& out=$(mktemp) && wget -nv -O$out https://cli.github.com/packages/githubcli-archive-keyring.gpg \
28+
&& cat $out | tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \
29+
&& chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
30+
&& mkdir -p -m 755 /etc/apt/sources.list.d \
31+
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
32+
&& apt update \
33+
&& apt install gh -y
34+
2435
COPY codon/pack.sh pack.sh
25-
RUN chmod +x pack.sh && ./pack.sh
36+
RUN --mount=type=secret,id=github_token GH_TOKEN=$(cat /run/secrets/github_token) ./pack.sh

release/codon/pack.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,7 @@ cp llvm-project/install/bin/llvm-objcopy release/armembeddon/bin/llvm-objcopy
1111
cp codon/install/bin/codon release/armembeddon/bin/codon
1212
cp -r codon/install/lib/codon/ release/armembeddon/lib/
1313

14-
tar cvzf armembeddon.tar.gz -C release armembeddon
14+
tar cvzf armembeddon.tar.gz -C release armembeddon
15+
16+
gh --version
17+
gh api user

0 commit comments

Comments
 (0)