2021-03-22 12:38:31 +00:00
|
|
|
name: "release"
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2021-03-22 12:45:50 +00:00
|
|
|
# uncomment to release only on tags starting with 'v'
|
2021-03-22 12:38:31 +00:00
|
|
|
# tags:
|
|
|
|
# - "v*"
|
|
|
|
branches:
|
2021-03-22 12:39:43 +00:00
|
|
|
- "main"
|
2021-03-22 12:38:31 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
release:
|
|
|
|
name: "Release"
|
|
|
|
runs-on: "ubuntu-latest"
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
|
|
|
### Setup
|
|
|
|
- uses: olafurpg/setup-scala@v10
|
|
|
|
|
|
|
|
### Update & build
|
2021-03-22 12:45:50 +00:00
|
|
|
- name: Assembly
|
2021-04-08 12:53:54 +00:00
|
|
|
run: sbt cli/assembly
|
2021-03-22 12:38:31 +00:00
|
|
|
|
|
|
|
### Create release
|
2021-03-22 13:55:07 +00:00
|
|
|
- name: Get project version
|
|
|
|
# In CI sbt appends a new line after its output, so we need `tail -n2 | head -n1`
|
|
|
|
run: |
|
2021-04-06 16:29:02 +00:00
|
|
|
VERSION="$(sbt 'print cli/version' |& tail -n2 | head -n1)"
|
2021-03-22 13:55:07 +00:00
|
|
|
echo "SBT_VERSION=$VERSION" >> $GITHUB_ENV
|
|
|
|
echo "VERSION=$VERSION-${{ github.run_number }}" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: Add version to .jar name
|
|
|
|
run: |
|
|
|
|
JAR="target/scala-2.13/aqua-hll-${{ env.VERSION }}.jar"
|
2021-04-08 12:53:54 +00:00
|
|
|
mv "cli/target/scala-2.13/aqua-hll.jar" $JAR
|
2021-03-22 13:55:07 +00:00
|
|
|
echo "JAR=$JAR" >> $GITHUB_ENV
|
|
|
|
|
2021-03-22 12:38:31 +00:00
|
|
|
- uses: marvinpinto/action-automatic-releases@latest
|
|
|
|
with:
|
2021-03-22 13:55:07 +00:00
|
|
|
# changelog will be automatically generated from the history
|
|
|
|
# between tag env.SBT_VERSION (eg 0.1.0 or 0.2.0, etc)
|
|
|
|
# and the current commit
|
|
|
|
automatic_release_tag: "${{ env.SBT_VERSION }}"
|
|
|
|
title: "Aqua Compiler ${{ env.VERSION }}"
|
2021-03-22 12:38:31 +00:00
|
|
|
files: |
|
2021-03-22 13:55:07 +00:00
|
|
|
${{ env.JAR }}
|
|
|
|
draft: true
|
|
|
|
prerelease: false
|
|
|
|
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|