Skip to content

Commit 61df8fa

Browse files
feat: use gh for auth
1 parent ecd311a commit 61df8fa

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

.github/workflows/release-codon.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ jobs:
5454
uses: docker/build-push-action@v5
5555
with:
5656
context: release
57+
secrets: |
58+
"github_token=${{ secrets.GITHUB_TOKEN }}"
5759
file: release/codon/Dockerfile
5860
push: true
5961
load: true

release/codon/Dockerfile

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,17 @@ 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) chmod +x pack.sh && ./pack.sh
37+

release/codon/pack.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@ 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 && gh auth status

0 commit comments

Comments
 (0)