release-otoroshi-biscuit-studio #8
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: release-otoroshi-biscuit-studio | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: "Version number" | |
jobs: | |
build-and-publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: setup jdk11 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 11 | |
- uses: sbt/setup-sbt@v1.1.5 | |
- uses: coursier/cache-action@v6 | |
- name: change version | |
run: | | |
echo 'ThisBuild / version := "${{ inputs.version }}"' > version.sbt | |
- name: build-libs | |
id: build-libs | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SBT_OPTS: -XX:MaxPermSize=8G -Xmx8G -Xss32M | |
run: | | |
sbt ';compile;package;assembly' | |
rm ./target/scala-2.12/otoroshi-biscuit-studio_2.12-${{ inputs.version }}.jar | |
mv ./target/scala-2.12/otoroshi-biscuit-studio-assembly_2.12-dev.jar ./target/scala-2.12/otoroshi-biscuit-studio-${{ inputs.version }}.jar | |
- name: Generate SHA-256 | |
run: | | |
shasum -a 256 ./target/scala-2.12/otoroshi-biscuit-studio-${{ inputs.version }}.jar | cut -d ' ' -f 1 > ./target/scala-2.12/otoroshi-biscuit-studio-${{ inputs.version }}.jar.sha256 | |
- name: Release binary and SHA-256 checksum to GitHub | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ inputs.version }} | |
files: | | |
./target/scala-2.12/otoroshi-biscuit-studio-${{ inputs.version }}.jar | |
./target/scala-2.12/otoroshi-biscuit-studio-${{ inputs.version }}.jar.sha256 | |
- name: update release version for README and DOCUMENTATION | |
run: | | |
cd scripts/ | |
sh ./change-release-version.sh --version ${{ inputs.version }} | |
- name: Commit files | |
run: | | |
echo 'ThisBuild / version := "dev"' > version.sbt | |
git config --local user.email "biscuit-studio-actions@users.noreply.github.com" | |
git config --local user.name "biscuit-studio-actions" | |
git add --all | |
git commit -am "change-biscuit-studio-release-version" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: 'main' |