Skip to content

release

release #75

Workflow file for this run

name: release
on:
push:
tags:
- 'v*'
workflow_dispatch: # allow to manually trigger this workflow
env:
REGISTRY: ghcr.io
IMAGE_NAME: appthreat/atom
jobs:
release:
if: github.repository_owner == 'appthreat'
concurrency: release
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: coursier/cache-action@v6
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '21'
- run: |
sbt stage astGenDlTask assembly createDistribution
sha512sum target/atom.zip > target/atom.zip.sha512
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: sbt publish
if: startsWith(github.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload atom to ghcr
run: |
cd target
echo $GITHUB_TOKEN | oras login ghcr.io -u $GITHUB_USERNAME --password-stdin
oras push ghcr.io/$IMAGE_NAME:v1 \
--annotation-file ../ci/annotations.json \
./atom.zip:application/vnd.appthreat.atom.layer.v1+tar \
./atom.zip.sha512:application/vnd.appthreat.atom.layer.v1+tar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_USERNAME: ${{ github.actor }}
- name: Create Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: |
target/atom.zip
target/atom.zip.sha512