-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (48 loc) · 1.73 KB
/
build_and_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
50
51
name: Build and release
on:
push:
branches: [master, main]
env:
OUTPUT_NAME: marker_pack_example # Change this to your desired file output name
jobs:
release:
runs-on: ubuntu-latest
if: "startsWith(github.event.head_commit.message, '[CI-BUILD]')"
permissions: write-all
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Zip files
uses: thedoctor0/[email protected]
with:
type: "zip"
filename: "${{ env.OUTPUT_NAME }}.taco"
exclusions: "*.git* /*.github/* install.bat"
- name: Get version
id: get_version
run: echo "::set-output name=version::$(echo ${{ github.event.head_commit.message }} | awk '{print $2}')"
- name: Get changelog
id: get_changelog
uses: mindsers/changelog-reader-action@v2
with:
validation_level: warn
version: ${{ steps.get_version.outputs.version }}
path: ./CHANGELOG.md
- name: Create tag
id: create_tag
run: |
TAG_NAME=${{ steps.get_changelog.outputs.version }}
git tag $TAG_NAME
echo "::set-output name=tag_name::$TAG_NAME"
git push origin --tags
- name: Create/update release
uses: ncipollo/release-action@v1
with:
artifacts: "${{ env.OUTPUT_NAME }}.taco"
tag: ${{ steps.get_changelog.outputs.version }}
name: ${{ steps.get_changelog.outputs.version }}
body: ${{ steps.get_changelog.outputs.changes }}
prerelease: ${{ steps.get_changelog.outputs.status == 'prereleased' }}
draft: ${{ steps.get_changelog.outputs.status == 'unreleased' }}
allowUpdates: true
token: ${{ secrets.GITHUB_TOKEN }}