aqua/.github/workflows/release.yml
Dmitry Kurinskiy 22778914ca
Topology refactoring & fixes (#371)
* Topology optimization for Folds

* cache RawCursor's parent for better performance

* Tests fixed

* wip

* wip

* Use the new Topology to find paths

* Compile bug fixed

* Old tests works

* One more fixed test

* Move before seq next

* One more fixed test

* Bugfix

* Disabled debug output

* maybe fix?

* maybe fix?

* Topology wip

* Maybe fix

* Maybe fix

* Fold optimization

* Root topology

* Respect forceExit in endsOn

* better caching

* better caching

* Root afterOn = const

* XorGroup endsOn should break

* no EndsOn for Root

* Maybe better?

* Uncycling

* Eval

* Respect ParTag.Detach

* Detach test

* Detach test failing

* Detach test fixed

* Go to relay via relay

* Fixes #380

* Increment Aqua version to 0.5.2

* Add image to transform readme, update dependencies

* Review fixes

* Updated Scala version in the release flow
2021-12-22 15:21:37 +03:00

111 lines
3.5 KiB
YAML

name: "release"
on:
workflow_dispatch:
inputs:
do_release:
description: "Set to 'true' to make a GitHub release"
required: true
default: "false"
jobs:
release:
name: "Publish ${{ github.event.inputs.do_release == 'true' && 'and release' || 'to NPM' }}"
runs-on: "ubuntu-latest"
env:
DO_RELEASE: ${{ github.event.inputs.do_release || 'false' }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
### Setup
- uses: olafurpg/setup-scala@v10
- name: JS build
run: sbt cliJS/fullLinkJS
env:
BUILD_NUMBER: ${{ github.run_number }}
- name: Get project version
# In CI sbt appends a new line after its output, so we need `tail -n3 | head -n2` to get last two non-empty lines
run: |
# Slower way of getting two variables from sbt. Try it if something breaks
#
# VERSION="$(sbt 'print cli/version' |& tail -n2 | head -n1)"
# BASE_VERSION="$(sbt 'print cli/baseAquaVersion' |& tail -n2 | head -n1)"
# print two versions as two lines
OUTPUT=$(sbt 'print cli/baseAquaVersion; print cli/version')
# read two lines to two variables
read -rd "\n" BASE_VERSION VERSION <<<$(echo "$OUTPUT" | tail -n3 | head -n2) || true
# debug output
echo "BASE_VERSION="$BASE_VERSION
echo "VERSION="$VERSION
echo "BASE_VERSION=$BASE_VERSION" >> $GITHUB_ENV
echo "VERSION=$VERSION" >> $GITHUB_ENV
env:
BUILD_NUMBER: ${{ github.run_number }}
- name: Check .js exists
run: |
JS="cli/.js/target/scala-3.1.0/cli-opt/aqua-${{ env.VERSION }}.js"
mv cli/.js/target/scala-3.1.0/cli-opt/main.js "$JS"
stat "$JS"
echo "JS=$JS" >> $GITHUB_ENV
### Publish to NPM registry
- uses: actions/setup-node@v1
with:
node-version: "15"
registry-url: "https://registry.npmjs.org"
- run: cp ${{ env.JS }} ./npm/aqua.js
- run: npm version ${{ env.VERSION }}
working-directory: ./npm
- name: Publish to NPM as aqua
run: npm publish --access public
working-directory: ./npm
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
### create release
# 'Push tag' will fail if such tag already exists
- name: Push tag ${{ env.BASE_VERSION }}
if: ${{ env.DO_RELEASE == 'true' }}
id: tag_version
uses: mathieudutour/github-tag-action@v5.5
with:
custom_tag: ${{ env.BASE_VERSION }}
tag_prefix: ""
github_token: ${{ secrets.PERSONAL_TOKEN }}
- name: Build Changelog
if: ${{ env.DO_RELEASE == 'true' }}
id: github_release
uses: mikepenz/release-changelog-builder-action@v1
with:
configuration: ".github/workflows/changelog_config.json"
toTag: ${{ steps.tag_version.outputs.new_tag }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release
if: ${{ env.DO_RELEASE == 'true' }}
uses: softprops/action-gh-release@v1
with:
name: Aqua Compiler ${{ env.VERSION }}
tag_name: ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.github_release.outputs.changelog }}
draft: false
prerelease: false
files: |
${{ env.JS }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}