-
Notifications
You must be signed in to change notification settings - Fork 57
47 lines (43 loc) · 1.59 KB
/
release.yaml
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
name: release
on:
push:
tags:
- v*
jobs:
build-appimage:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Parse the Version
id: version
run: |
echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
echo ::set-output name=PRERELEASE::$(
[[ ! $GITHUB_REF =~ ^refs\/tags\/v[0-9]+\.[0-9]+\.[0-9]+$ ]] && echo "true"
)
- name: Set up APPDIR for after_bundle
run: echo "APPDIR=$PWD/AppDir" >> $GITHUB_ENV
- name: Build AppImage
uses: AppImageCrafters/build-appimage@v1.3
with:
recipe: './appimage-builder.yml'
env:
APP_VERSION: ${{ steps.version.outputs.VERSION }}
- name: Generate Changelog
id: changelog
run: |
git fetch --unshallow
PREVIOUS_TAG="$(git describe --abbrev=0 --tags $(git rev-list --tags --skip=1 --max-count=1))"
CHANGELOG="$(git --no-pager log --pretty="format:- %s" $PREVIOUS_TAG..${{ steps.version.outputs.VERSION }})"
CHANGELOG="${CHANGELOG//'%'/'%25'}"
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}"
CHANGELOG="${CHANGELOG//$'\r'/'%0D'}"
echo "::set-output name=CHANGELOG::$CHANGELOG"
- name: Create Release
uses: ncipollo/release-action@v1
with:
name: ${{ steps.version.outputs.VERSION }}
artifacts: 'rclip-*.AppImage'
body: ${{ steps.changelog.outputs.CHANGELOG || 'internal release' }}
prerelease: ${{ steps.version.outputs.PRERELEASE }}
token: ${{ secrets.GITHUB_TOKEN }}