-
Notifications
You must be signed in to change notification settings - Fork 2
49 lines (41 loc) · 1.24 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
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 }}