v2.9.7 #11
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish release | |
on: | |
release: | |
types: [ created ] | |
workflow_dispatch: | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
permissions: | |
contents: read | |
packages: write | |
outputs: | |
version: ${{ steps.project.outputs.version }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'temurin' | |
cache: maven | |
- name: Build with Maven | |
run: mvn --batch-mode --update-snapshots clean install --activate-profiles ui -DskipTests # tests are run in the docker build | |
- run: mkdir staging && cp target/*.jar staging | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: Package | |
path: staging | |
# From https://stackoverflow.com/a/65740844 | |
- name: Extract Maven project version | |
run: echo "version=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)" >> $GITHUB_OUTPUT | |
id: project | |
- name: Show extracted Maven project version | |
run: echo ${{ steps.project.outputs.version }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
with: | |
image: tonistiigi/binfmt:latest | |
platforms: arm64,arm | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Test Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
platforms: linux/amd64 | |
context: . | |
target: test | |
build-args: | | |
bitwardenEmailFolderId=${{ secrets.BITWARDENEMAILFOLDERID }} | |
BW_CLIENTID=${{ secrets.BW_CLIENTID }} | |
BW_CLIENTSECRET=${{ secrets.BW_CLIENTSECRET }} | |
testItemId=${{ secrets.TESTITEMID }} | |
testMasterPassword=${{ secrets.TESTMASTERPASSWORD }} | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build image and push to Docker Hub | |
uses: docker/build-push-action@v5 | |
with: | |
platforms: linux/amd64 | |
context: . | |
tags: | | |
stevenmassaro/email:latest | |
stevenmassaro/email:${{ steps.project.outputs.version }} | |
push: true |