fix shebang #58
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 | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: setup eli | |
uses: alis-is/setup-eli@v1 | |
- name: test ami | |
run: | | |
eli ./tests/all.lua | |
- name: prep | |
id: prep | |
run: | | |
VERSION=$(eli -e "info = require'src.version-info'; io.write(info.VERSION)") | |
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT | |
if git tag -l "$VERSION" | grep "$VERSION"; then | |
echo "Version $VERSION already exists"; | |
else | |
echo "Found new version - $VERSION" | |
echo "NEEDS_RELEASE=true" >> $GITHUB_OUTPUT | |
fi | |
- name: build ami | |
if: ${{ steps.prep.outputs.NEEDS_RELEASE == 'true'}} | |
run: | | |
export ELI_PATH=$PWD/eli | |
eli ./build/build.lua | |
cd .meta && zip ../meta.zip -r * && cd .. | |
- name: publish | |
uses: ncipollo/release-action@v1 | |
if: ${{ steps.prep.outputs.NEEDS_RELEASE == 'true'}} | |
with: | |
artifacts: "meta.zip,bin/ami.lua,bin/exit-codes.json" | |
tag: ${{ steps.prep.outputs.VERSION }} | |
token: ${{ secrets.GITHUB_TOKEN }} |