-
Notifications
You must be signed in to change notification settings - Fork 40
60 lines (52 loc) · 1.83 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
52
53
54
55
56
57
58
59
name: Release
on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v6.1.1, v7.0.0
workflow_dispatch:
inputs:
tag:
description: 'Version (name of the tag to be referenced)'
required: true
jobs:
build:
name: Upload Release Asset
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Download last artifact
uses: dawidd6/action-download-artifact@v2
with:
workflow: package.yml
workflow_conclusion: success
name: TotalCross
path: ../TotalCross
- name: "ZIP TotalCross"
run: |
zip -r TotalCross-${{ github.event.inputs.tag }}.zip ../TotalCross
- name: "CHANGELOG Release ${{ github.event.inputs.tag }}"
run: |
version=$(echo '${{ github.event.inputs.tag }}' | sed 's/v//g')
sed -n '/^## '$version'/,/^## /p' CHANGELOG.md | sed -e '$d' > CHANGELOG-${{ github.event.inputs.tag }}.md
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.inputs.tag }}
release_name: Release ${{ github.event.inputs.tag }}
body_path: CHANGELOG-${{ github.event.inputs.tag }}.md
draft: false
prerelease: false
- name: Upload Release ZIP
id: upload-zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./TotalCross-${{ github.event.inputs.tag }}.zip
asset_name: TotalCross-${{ github.event.inputs.tag }}.zip
asset_content_type: application/zip