-
-
Notifications
You must be signed in to change notification settings - Fork 18
84 lines (80 loc) · 2.78 KB
/
create_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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: '🗃️ Create empty release'
on:
push:
branches:
- release
tags-ignore:
- '*'
workflow_dispatch:
env:
APP_NAME: qownnotesapi
jobs:
create_release:
name: '🗃️️ Prepare release'
permissions:
contents: write # for actions/create-release to create a release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
release_id: ${{ steps.create_release.outputs.id }}
steps:
- uses: actions/checkout@v3
- name: Install libxml2-utils
run: sudo apt-get install libxml2-utils
- name: Set Env
run: |
export VERSION=$(xmllint --xpath "string(/info/version)" appinfo/info.xml)
export TAG=v${VERSION}
export RELEASE_TEXT=$(grep -Pzo "## ${VERSION}\n(\n|.)+?\n##" CHANGELOG.md | sed '$ d')
echo "VERSION=${VERSION}" >> $GITHUB_ENV
echo "TAG=${TAG}" >> $GITHUB_ENV
# add multiline release text
echo "RELEASE_TEXT<<EOF" >> $GITHUB_ENV
echo "${RELEASE_TEXT}" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Printenv
run: |
echo "VERSION=${VERSION}"
echo "TAG=${TAG}"
echo "RELEASE_TEXT=${RELEASE_TEXT}"
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.TAG }}
release_name: Release v${{ env.VERSION }}
body: ${{ env.RELEASE_TEXT }}
draft: true
prerelease: false
# build_and_publish:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# with:
# path: ${{ env.APP_NAME }}
# - name: Install NPM packages
# run: cd ${{ env.APP_NAME }} && make npm-init
# - name: Build JS
# run: cd ${{ env.APP_NAME }} && make build-js-production
# - name: Create release tarball
# run: cd ${{ env.APP_NAME }} && make appstore
# - name: Upload app tarball to release
# uses: svenstaro/upload-release-action@v2
# id: attach_to_release
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: ${{ env.APP_NAME }}/build/artifacts/${{ env.APP_NAME }}.tar.gz
# asset_name: ${{ env.APP_NAME }}.tar.gz
# tag: ${{ github.ref }}
# overwrite: true
# - name: Upload app to Nextcloud appstore
# uses: R0Wi/nextcloud-appstore-push-action@v1.0.3
# with:
# app_name: ${{ env.APP_NAME }}
# appstore_token: ${{ secrets.APPSTORE_TOKEN }}
# download_url: ${{ steps.attach_to_release.outputs.browser_download_url }}
# app_private_key: ${{ secrets.APP_PRIVATE_KEY }}
# nightly: false