-
Notifications
You must be signed in to change notification settings - Fork 117
60 lines (60 loc) · 2.01 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
60
name: Release
on:
workflow_dispatch:
inputs:
version:
description: 'Release version'
required: true
targetBranch:
description: 'TargetBranch to tag (e.g. release/3.x)'
required: true
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout Branch
uses: actions/checkout@v2
with:
ref: dev
fetch-depth: 0
token: ${{ secrets.PIPELINE_ADMIN }}
- name: Create Release Tag
id: createBranch
run: |
set -e
git config --local user.email "azfuncgh@github.com"
git config --local user.name "Azure Functions"
git fetch --all
git checkout -b ${{ github.event.inputs.targetBranch }} origin/${{ github.event.inputs.targetBranch }}
git merge dev
git tag ${{ github.event.inputs.version }}
git push
git push origin ${{ github.event.inputs.version }}
env:
GITHUB_TOKEN: ${{ secrets.PIPELINE_ADMIN }}
- name: Release Drafter
id: release
uses: release-drafter/release-drafter@v5.15.0
with:
tag: ${{ github.event.inputs.version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name : Generate v3 Assets
if : startsWith(github.event.inputs.version, '3')
run: |
./host/generate-composite.sh -3 -r all
zip -r ${{ github.event.inputs.version }}.zip ./host/3.0/buster/amd64/release/
- name : Generate v4 Assets
if : startsWith(github.event.inputs.version, '4')
run: |
./host/generate-composite.sh -4 -r all
zip -r ${{ github.event.inputs.version }}.zip ./host/4/bullseye/release/
- name: Attach Assets to Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.release.outputs.upload_url }}
asset_path: ./${{ github.event.inputs.version }}.zip
asset_name: ${{ github.event.inputs.version }}-appservice.zip
asset_content_type: application/zip