Some improvements

This commit is contained in:
Xiaonan Shen
2022-05-04 21:57:08 +08:00
parent 62a2ad4034
commit fa9ac0152e
5 changed files with 16 additions and 12 deletions

View File

@@ -24,9 +24,11 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@master uses: actions/checkout@master
- name: Set version - name: Set bridge version
id: version id: version
run: echo "::set-output name=version::`cat VERSION`" run: |
echo "::set-output name=bridge_version::$(cat BRIDGE_VERSION)"
echo "::set-output name=version::$(cat VERSION)"
- name: Set repo - name: Set repo
id: repo id: repo
run: if [[ $GITHUB_REF == "refs/heads/master" ]]; then echo "::set-output name=repo::${DOCKER_REPO}"; else echo "::set-output name=repo::${DOCKER_REPO_DEV}"; fi run: if [[ $GITHUB_REF == "refs/heads/master" ]]; then echo "::set-output name=repo::${DOCKER_REPO}"; else echo "::set-output name=repo::${DOCKER_REPO_DEV}"; fi
@@ -45,6 +47,7 @@ jobs:
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:
platforms: ${{ env.PLATFORMS }} platforms: ${{ env.PLATFORMS }}
build-args: BRIDGE_VERSION=${{ steps.version.outputs.bridge_version }}
push: true push: true
tags: localhost:5000/protonmail-bridge:latest tags: localhost:5000/protonmail-bridge:latest
- name: Scan image - name: Scan image
@@ -75,11 +78,11 @@ jobs:
- name: Push image - name: Push image
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
with: with:
context: ./build
file: ./build/Dockerfile
platforms: ${{ env.PLATFORMS }} platforms: ${{ env.PLATFORMS }}
build-args: BRIDGE_VERSION=${{ steps.version.outputs.bridge_version }}
tags: | tags: |
${{ steps.repo.outputs.repo }}:build ${{ steps.repo.outputs.repo }}:beta
${{ steps.repo.outputs.repo }}:${{ steps.version.outputs.version }}-build ${{ steps.repo.outputs.repo }}:${{ steps.version.outputs.version }}
${{ steps.repo.outputs.repo }}:${{ steps.version.outputs.bridge-version }}-${{ steps.version.outputs.version }}
labels: ${{ steps.docker_meta.outputs.labels }} labels: ${{ steps.docker_meta.outputs.labels }}
push: ${{ github.event_name != 'pull_request' }} push: ${{ github.event_name != 'pull_request' }}

1
BRIDGE_VERSION Normal file
View File

@@ -0,0 +1 @@
v2.1.3

View File

@@ -3,9 +3,11 @@ FROM golang:1.15 AS build
# Install dependencies # Install dependencies
RUN apt-get update && apt-get install -y libsecret-1-dev RUN apt-get update && apt-get install -y libsecret-1-dev
ARG BRIDGE_VERSION
# Build # Build
WORKDIR /build/ WORKDIR /build/
COPY build.sh VERSION /build/ COPY build.sh /build/
COPY http_rest_frontend /build/http_rest_frontend COPY http_rest_frontend /build/http_rest_frontend
RUN bash build.sh RUN bash build.sh

View File

@@ -1 +1 @@
2.1.3 2.0-beta

View File

@@ -7,13 +7,11 @@ VERSION=`cat VERSION`
# Clone new code # Clone new code
git clone https://github.com/ProtonMail/proton-bridge.git git clone https://github.com/ProtonMail/proton-bridge.git
cd proton-bridge cd proton-bridge
git checkout v$VERSION git checkout ${BRIDGE_VERSION}
ls /build
# Patch HTTP REST frontend # Patch HTTP REST frontend
rm -rf internal/frontend/cli rm -rf internal/frontend/cli
cp -r /build/http_rest_frontend/cli internal/frontend/cli cp -r /build/http_rest_frontend/cli internal/frontend/
# Build # Build
if ! make build-nogui ; then if ! make build-nogui ; then