mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 02:20:39 +00:00
Publish docker image to ghcr
This commit is contained in:
parent
00535c9a42
commit
6502f3f487
3 changed files with 112 additions and 0 deletions
98
.github/workflows/release.yml
vendored
98
.github/workflows/release.yml
vendored
|
@ -5,6 +5,12 @@ on:
|
||||||
tags:
|
tags:
|
||||||
- v*
|
- v*
|
||||||
|
|
||||||
|
env:
|
||||||
|
IMAGE_NAME: signal-cli
|
||||||
|
IMAGE_REGISTRY: ghcr.io/asamk
|
||||||
|
REGISTRY_USER: ${{ github.actor }}
|
||||||
|
REGISTRY_PASSWORD: ${{ github.token }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
ci_wf:
|
ci_wf:
|
||||||
|
@ -191,3 +197,95 @@ jobs:
|
||||||
EXECUTABLE_SUFFIX=".bat"
|
EXECUTABLE_SUFFIX=".bat"
|
||||||
fi
|
fi
|
||||||
./signal-cli${EXECUTABLE_SUFFIX} listAccounts
|
./signal-cli${EXECUTABLE_SUFFIX} listAccounts
|
||||||
|
|
||||||
|
build-container:
|
||||||
|
needs: ci_wf
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Download signal-cli build from CI workflow
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
|
||||||
|
- name: Get signal-cli version
|
||||||
|
id: cli_ver
|
||||||
|
run: |
|
||||||
|
ver="${GITHUB_REF_NAME#v}"
|
||||||
|
echo "version=${ver}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Move archive file
|
||||||
|
run: |
|
||||||
|
ARCHIVE_DIR=$(ls signal-cli-archive-*/ -d | tail -n1)
|
||||||
|
tar xf ./"${ARCHIVE_DIR}"/*.tar.gz
|
||||||
|
rm -r signal-cli-archive-* signal-cli-native
|
||||||
|
mkdir -p build/install/
|
||||||
|
mv ./signal-cli-*/ build/install/signal-cli
|
||||||
|
|
||||||
|
- name: Build Image
|
||||||
|
id: build_image
|
||||||
|
uses: redhat-actions/buildah-build@v2
|
||||||
|
with:
|
||||||
|
image: ${{ env.IMAGE_NAME }}
|
||||||
|
tags: latest ${{ github.sha }} ${{ steps.cli_ver.outputs.version }}
|
||||||
|
containerfiles:
|
||||||
|
./Containerfile
|
||||||
|
oci: true
|
||||||
|
|
||||||
|
- name: Push To GHCR
|
||||||
|
uses: redhat-actions/push-to-registry@v2
|
||||||
|
id: push
|
||||||
|
with:
|
||||||
|
image: ${{ steps.build_image.outputs.image }}
|
||||||
|
tags: ${{ steps.build_image.outputs.tags }}
|
||||||
|
registry: ${{ env.IMAGE_REGISTRY }}
|
||||||
|
username: ${{ env.REGISTRY_USER }}
|
||||||
|
password: ${{ env.REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Echo outputs
|
||||||
|
run: |
|
||||||
|
echo "${{ toJSON(steps.push.outputs) }}"
|
||||||
|
|
||||||
|
build-container-native:
|
||||||
|
needs: ci_wf
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Download signal-cli build from CI workflow
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
|
||||||
|
- name: Get signal-cli version
|
||||||
|
id: cli_ver
|
||||||
|
run: |
|
||||||
|
ver="${GITHUB_REF_NAME#v}"
|
||||||
|
echo "version=${ver}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Move archive file
|
||||||
|
run: |
|
||||||
|
mkdir -p build/native/nativeCompile/
|
||||||
|
chmod +x ./signal-cli-native/signal-cli
|
||||||
|
mv ./signal-cli-native/signal-cli build/native/nativeCompile/
|
||||||
|
|
||||||
|
- name: Build Image
|
||||||
|
id: build_image
|
||||||
|
uses: redhat-actions/buildah-build@v2
|
||||||
|
with:
|
||||||
|
image: ${{ env.IMAGE_NAME }}
|
||||||
|
tags: latest-native ${{ github.sha }}-native ${{ steps.cli_ver.outputs.version }}-native
|
||||||
|
containerfiles:
|
||||||
|
./native.Containerfile
|
||||||
|
oci: true
|
||||||
|
|
||||||
|
- name: Push To GHCR
|
||||||
|
uses: redhat-actions/push-to-registry@v2
|
||||||
|
id: push
|
||||||
|
with:
|
||||||
|
image: ${{ steps.build_image.outputs.image }}
|
||||||
|
tags: ${{ steps.build_image.outputs.tags }}
|
||||||
|
registry: ${{ env.IMAGE_REGISTRY }}
|
||||||
|
username: ${{ env.REGISTRY_USER }}
|
||||||
|
password: ${{ env.REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Echo outputs
|
||||||
|
run: |
|
||||||
|
echo "${{ toJSON(steps.push.outputs) }}"
|
||||||
|
|
7
Containerfile
Normal file
7
Containerfile
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
FROM docker.io/eclipse-temurin:17-jre
|
||||||
|
|
||||||
|
RUN useradd signal-cli --system --create-home --home-dir /var/lib/signal-cli
|
||||||
|
ADD build/install/signal-cli /opt/signal-cli
|
||||||
|
|
||||||
|
USER signal-cli
|
||||||
|
ENTRYPOINT ["/opt/signal-cli/bin/signal-cli", "--config=/var/lib/signal-cli"]
|
7
native.Containerfile
Normal file
7
native.Containerfile
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
FROM docker.io/debian:testing-slim
|
||||||
|
|
||||||
|
RUN useradd signal-cli --system --create-home --home-dir /var/lib/signal-cli
|
||||||
|
ADD build/native/nativeCompile/signal-cli /usr/bin/signal-cli
|
||||||
|
|
||||||
|
USER signal-cli
|
||||||
|
ENTRYPOINT ["/usr/bin/signal-cli", "--config=/var/lib/signal-cli"]
|
Loading…
Add table
Add a link
Reference in a new issue