Skip to content

Fix Dockerfile

Fix Dockerfile #173

Workflow file for this run

name: build
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Compile
run: ./mill _.compile
- name: Test
run: ./mill _.test
- name: Build distributable
run: ./mill cmd.assembly
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push cmd images
uses: docker/build-push-action@v2
with:
context: .
file: cmd/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/torrentdam/cmd:latest
build-native:
if: false
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v1
- uses: actions/cache@v1
with:
path: ~/.cache/coursier/v1
key: ${{ runner.os }}-coursier-${{ hashFiles('**/build.sbt') }}
- name: Set up java
uses: actions/setup-java@v2.1.0
with:
distribution: adopt
java-version: 17
java-package: jre
- name: Build Native
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: sbt -J-Xmx4g cmdNative/nativeLink
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push cmd images
uses: docker/build-push-action@v2
with:
context: cmd
file: cmd/Dockerfile-native
platforms: linux/amd64
push: true
tags: ghcr.io/torrentdam/cmd-native:latest
release:
if: startsWith(github.ref, 'refs/tags/v')
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Release
env:
MILL_SONATYPE_USERNAME: ${{ secrets.MILL_SONATYPE_USERNAME }}
MILL_SONATYPE_PASSWORD: ${{ secrets.MILL_SONATYPE_PASSWORD }}
MILL_PGP_SECRET_BASE64: ${{ secrets.MILL_PGP_SECRET_BASE64 }}
MILL_PGP_PASSPHRASE: ${{ secrets.MILL_PGP_PASSPHRASE }}
run: |
export VERSION=${GITHUB_REF#*/v}
echo Publishing $VERSION
./mill common.publishSonatypeCentral dht.publishSonatypeCentral bittorrent.publishSonatypeCentral cmd.publishSonatypeCentral