Update sbt-scalafix to 0.12.1 #1078
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: ci | |
on: [push, pull_request] | |
jobs: | |
ci: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'adopt' | |
java-version: 11 | |
- name: Run tests | |
run: sbt coverage test coverageReport | |
- name: Upload coverage reports | |
uses: codecov/codecov-action@v4 | |
with: | |
fail_ci_if_error: true | |
verbose: true | |
token: ${{ secrets.CODECOV_TOKEN }} | |
create-github-release-draft: | |
needs: [ci] | |
if: startsWith(github.ref, 'refs/tags/v') | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Create GitHub release draft | |
uses: release-drafter/release-drafter@v6 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
version: ${{ github.ref }} | |
build-docker-images: | |
needs: [ci] | |
if: startsWith(github.ref, 'refs/tags/v') | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'adopt' | |
java-version: 11 | |
- name: Login to GitHub Container Registry | |
uses: docker/[email protected] | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create and publish a docker image with a UPX compressed executable | |
run: export UPX_COMPRESSION='--best'; sbt ';docker;dockerPush' | |
- name: Create and publish a docker image without compression | |
run: sbt ';docker;dockerPush' | |
- name: Remove image with UPX compressed executable | |
run: docker rmi $(docker images -q 'ghcr.io/usommerl/graalnative4s*upx*') | |
- name: Tag remaining image for Google Container Registry | |
run: | | |
export IMAGE_GHCR=$(docker images ghcr.io/usommerl/graalnative4s --format "{{.Repository}}:{{.Tag}}") | |
export IMAGE_GCR=$(echo $IMAGE_GHCR | sed 's/ghcr.io\/usommerl/eu.gcr.io\/usommerl-02/') | |
docker tag $IMAGE_GHCR $IMAGE_GCR | |
echo "image_gcr=$IMAGE_GCR" >> $GITHUB_ENV | |
- name: Login to Google Container Registry | |
uses: docker/[email protected] | |
with: | |
registry: eu.gcr.io | |
username: _json_key | |
password: ${{ secrets.GCP_SA_KEY_JSON }} | |
- name: Push image to Google Container Registry | |
run: docker push ${{ env.image_gcr }} |