-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (43 loc) · 1.63 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
50
51
name: zshlib.zwc Release
on:
push:
tags: [ v* ]
workflow_dispatch:
jobs:
build:
# The type of runner that the job will run on
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
# Runs a set of commands using the runners shell
- name: Compile library with zcompile
shell: zsh {0}
run: zcompile -zU ./zshlib $(find ./functions -type f -perm +u=x -maxdepth 1)
- name: Get zsh version
shell: zsh {0}
run: echo zsh-version=$ZSH_VERSION >> $GITHUB_OUTPUT
id: zsh-version
- name: Create Release Notes
shell: zsh {0}
run: awk -v start=0 '/^## \[v([[:digit:]]+\.?)+\] - [[:digit:]]{4}-[[:digit:]]{2}-[[:digit:]]{2}/ { if(start == 0) start=1; else if(start == 1) start=2; }; /^\[[^]]+\]:/ { start=2; print }; { if (start == 1) print };' ./CHANGELOG.md > ./RELEASE_NOTES.md
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: Release ${{ github.ref_name }}
body_path: ./RELEASE_NOTES.md
draft: false
prerelease: false
- name: Upload zsh word code
id: upload-zwc
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./zshlib.zwc
asset_name: zshlib${{ steps.zsh-version.outputs.zsh-version }}.zwc
asset_content_type: application/octet-stream