mirror of
https://github.com/shenxn/protonmail-bridge-docker.git
synced 2025-12-06 08:27:08 +00:00
Add GitHub Actions
This commit is contained in:
parent
566735cf74
commit
f8e83cf877
@ -1,6 +1,8 @@
|
||||
*
|
||||
|
||||
!.dockerignore
|
||||
!*.sh
|
||||
!releaserc
|
||||
!entrypoint.sh
|
||||
!install.sh
|
||||
!gpgparams
|
||||
!Dockerfile
|
||||
|
||||
52
.github/workflows/main.yaml
vendored
Normal file
52
.github/workflows/main.yaml
vendored
Normal file
@ -0,0 +1,52 @@
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
|
||||
env:
|
||||
DOCKER_TAG: shenxn/protonmail-bridge
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@master
|
||||
- name: Set Env
|
||||
run: |
|
||||
source releaserc
|
||||
echo "::set-env name=RELEASE::${RELEASE}"
|
||||
echo "::set-env name=DEB_FILE::${DEB_FILE}"
|
||||
- name: Repack deb
|
||||
run: bash repack-deb.sh
|
||||
- name: Create Release
|
||||
id: create-release
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: ${{ env.RELEASE }}
|
||||
release_name: Release ${{ env.RELEASE }}
|
||||
body: Repacked ProtonMail Bridge deb without dependencies not needed by cli mode.
|
||||
draft: false
|
||||
prerelease: false
|
||||
- name: Upload Release Asset
|
||||
id: upload-release-asset
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create-release.outputs.upload_url }}
|
||||
asset_path: ./deb/${{ env.DEB_FILE }}
|
||||
asset_name: ${{ env.DEB_FILE }}
|
||||
asset_content_type: application/vnd.debian.binary-package
|
||||
- name: Docker Login
|
||||
uses: azure/docker-login@v1
|
||||
with:
|
||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
- name: Docker Build
|
||||
run: |
|
||||
docker build . -t ${DOCKER_TAG}:latest -t ${DOCKER_TAG}:${RELEASE}
|
||||
docker push ${DOCKER_TAG}:latest
|
||||
docker push ${DOCKER_TAG}:${RELEASE}
|
||||
10
.gitignore
vendored
10
.gitignore
vendored
@ -1,9 +1 @@
|
||||
*
|
||||
|
||||
!.gitignore
|
||||
!.dockerignore
|
||||
!LICENSE
|
||||
!README.md
|
||||
!*.sh
|
||||
!gpgparams
|
||||
!Dockerfile
|
||||
deb
|
||||
|
||||
11
Dockerfile
11
Dockerfile
@ -1,18 +1,11 @@
|
||||
FROM debian:buster-slim AS setup
|
||||
|
||||
COPY setup.sh /bin/
|
||||
RUN bash /bin/setup.sh
|
||||
|
||||
|
||||
FROM debian:buster-slim
|
||||
LABEL maintainer="Xiaonan Shen <s@sxn.dev>"
|
||||
|
||||
EXPOSE 25/tcp
|
||||
EXPOSE 143/tcp
|
||||
|
||||
# Copy gpg parameters and .deb installer
|
||||
COPY gpgparams install.sh entrypoint.sh /protonmail/
|
||||
COPY --from=setup /protonmail/protonmail.deb /protonmail/
|
||||
# Copy bash scripts
|
||||
COPY gpgparams install.sh entrypoint.sh releaserc /protonmail/
|
||||
|
||||
# Install dependencies and protonmail bridge
|
||||
RUN bash /protonmail/install.sh
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -ex
|
||||
|
||||
# Initialize
|
||||
if [[ $1 == init ]]; then
|
||||
|
||||
13
install.sh
13
install.sh
@ -1,11 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -x
|
||||
set -ex
|
||||
|
||||
source /protonmail/releaserc
|
||||
|
||||
# Install dependents
|
||||
# libgl1-mesa-glx is installed since the bridge requires libgl and we removed the qt dependencies
|
||||
apt-get update
|
||||
apt-get install -y --no-install-recommends socat pass libgl1-mesa-glx
|
||||
apt-get install -y --no-install-recommends socat pass
|
||||
|
||||
# Download repacked deb
|
||||
apt-get install -y wget
|
||||
wget -O /protonmail/protonmail.deb https://github.com/shenxn/protonmail-bridge-docker/releases/download/${RELEASE}/${DEB_FILE}
|
||||
apt-get purge -y wget
|
||||
apt-get autoremove -y
|
||||
|
||||
# Install protonmail bridge
|
||||
apt-get install -y --no-install-recommends /protonmail/protonmail.deb
|
||||
|
||||
2
releaserc
Normal file
2
releaserc
Normal file
@ -0,0 +1,2 @@
|
||||
RELEASE=1.2.6-1
|
||||
DEB_FILE=protonmail-bridge_${RELEASE}_amd64.deb
|
||||
25
repack-deb.sh
Normal file
25
repack-deb.sh
Normal file
@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
|
||||
source releaserc
|
||||
|
||||
# Download deb
|
||||
mkdir deb
|
||||
cd deb
|
||||
rm -f ${DEB_FILE}
|
||||
wget https://protonmail.com/download/${DEB_FILE}
|
||||
|
||||
# Unpack deb
|
||||
ar x -v ${DEB_FILE}
|
||||
mkdir control
|
||||
tar xvfJ control.tar.xz -C control
|
||||
|
||||
# Replace qt with libgl and remove unnecessary dependencies
|
||||
sed -i "s/^Depends: .*$/Depends: libsecret-1-0, libgl1-mesa-glx/" control/control
|
||||
|
||||
# Pack deb
|
||||
cd control
|
||||
tar cvfJ ../control.tar.xz .
|
||||
cd ../
|
||||
ar rcs -v ${DEB_FILE} debian-binary control.tar.xz data.tar.xz
|
||||
24
setup.sh
24
setup.sh
@ -1,24 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -x
|
||||
|
||||
DEB_URL=https://protonmail.com/download/protonmail-bridge_1.2.6-1_amd64.deb
|
||||
|
||||
# Install tools
|
||||
apt-get update
|
||||
apt-get install -y wget binutils xz-utils
|
||||
|
||||
# Download deb
|
||||
mkdir /protonmail
|
||||
cd /protonmail
|
||||
wget -O /protonmail/protonmail.deb ${DEB_URL}
|
||||
|
||||
# Remove unnecessary dependencies
|
||||
ar x -v protonmail.deb
|
||||
mkdir control
|
||||
tar xvfJ control.tar.xz -C control
|
||||
cd control
|
||||
sed -i "s/^Depends: .*$/Depends: libsecret-1-0/" control
|
||||
tar cvfJ ../control.tar.xz .
|
||||
cd ../
|
||||
ar rcs -v protonmail.deb debian-binary control.tar.xz data.tar.xz
|
||||
Loading…
Reference in New Issue
Block a user