Skip to content

Repository name

Repository name #3

Workflow file for this run

name: Release
on:
push:
tags: ["*"]
jobs:
release:
# runs on main repo only
if: github.repository == 'EducationPerfect/kafka-lag-exporter'
name: Release
runs-on: ubuntu-22.04
permissions:
id-token: write
contents: write
issues: write
pull-requests: write
checks: write
strategy:
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup environment
id: setup
run: |
echo "repository_name=$(echo ${{ github.repository }} | cut -d'/' -f2)" >> $GITHUB_OUTPUT
- name: Checkout GitHub merge
if: github.event.pull_request
run: |-
git fetch origin pull/${{ github.event.pull_request.number }}/merge:scratch
git checkout scratch
- name: Setup Scala with Java ${{ matrix.java-version }}
uses: olafurpg/setup-scala@v13
with:
java-version: [email protected]
- name: Cache Coursier cache
uses: coursier/cache-action@v6
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ap-southeast-2
role-to-assume: arn:aws:iam::058337015204:role/github-actions/${{ steps.setup.outputs.repository_name }}
role-session-name: github-actions-tf
- name: Login to Amazon ECR
uses: aws-actions/amazon-ecr-login@v2
id: login-ecr
- name: Build, test, and publish
run: |+
TAG=$(git describe --tags --abbrev=0 | sed "s/v//g")
sbt "release with-defaults release-version $TAG"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add . && git commit -m "Released v$TAG"
- name: Push changes
uses: ad-m/[email protected]
with:
github_token: ${{ github.token }}
branch: main
- name: Push GitHub release artifact
uses: softprops/action-gh-release@v1
with:
prerelease: true
files: |
repo/kafka-lag-exporter-*.tgz
target/universal/kafka-lag-exporter-*.zip
- name: Print logs on failure
if: ${{ failure() }}
run: find . -name "*.log" -exec ./scripts/cat_log.sh {} \;