Repository navigation
88 lines (73 loc) · 2.78 KB
/
Copy pathps-ce-sdk-release.yaml
File metadata and controls
88 lines (73 loc) · 2.78 KB
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
85
86
87
# **************************************************************************
# Copyright (c) Cloud Native Foundation.
# SPDX-License-Identifier: Apache-2.0
# **************************************************************************
name: Release
on:
push:
tags:
- v*
workflow_dispatch:
jobs:
psgallery-publish:
name: Release CloudEvents.Sdk Module
runs-on: "ubuntu-latest"
env:
OUTPUT_DIR: release
CHANGE_LOG_FILE_NAME: RELEASE_CHANGELOG.md
timeout-minutes: 10
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Build and Test
shell: pwsh
run: ./build.ps1 -OutputDir $env:OUTPUT_DIR -TestsType all -ExitProcess
- name: Publish to PSGallery
shell: pwsh
run: ./publish.ps1 -ModuleReleaseDir $env:OUTPUT_DIR -NuGetApiKey ${{ secrets.CLOUDEVENTS_SDK_PUBLISHER_API_KEY }}
- name: Create CHANGELOG
env:
IMAGE: quay.io/git-chglog/git-chglog
# https://quay.io/repository/git-chglog/git-chglog from tag v0.14.2
IMAGE_SHA: 998e89dab8dd8284cfff5f8cfb9e9af41fe3fcd4671f2e86a180e453c20959e3
run: |
# generate CHANGELOG for this Github release tag only
docker run --rm -v $PWD:/workdir ${IMAGE}@sha256:${IMAGE_SHA} -o ${CHANGE_LOG_FILE_NAME} $(basename "${{ github.ref }}" )
- name: Create Github Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release create $(basename "${{ github.ref }}") -F ${CHANGE_LOG_FILE_NAME}
changelog-pull-request:
needs: psgallery-publish
name: Create CHANGELOG PR
runs-on: ubuntu-latest
continue-on-error: true
env:
CHANGE_LOG_FILE_NAME: CHANGELOG.md
steps:
- name: Checkout
uses: actions/checkout@v2
with:
# for changelog
fetch-depth: 0
ref: "main"
- name: Create CHANGELOG commit
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
IMAGE: quay.io/git-chglog/git-chglog
# https://quay.io/repository/git-chglog/git-chglog from tag v0.14.2
IMAGE_SHA: 998e89dab8dd8284cfff5f8cfb9e9af41fe3fcd4671f2e86a180e453c20959e3
run: |
# update CHANGELOG.md
docker run --rm -v $PWD:/workdir ${IMAGE}@sha256:${IMAGE_SHA} -o ${CHANGE_LOG_FILE_NAME}
git config user.email "${{ github.actor }}@users.noreply.github.com"
git config user.name "${{ github.actor }}"
git add ${CHANGE_LOG_FILE_NAME}
git commit -m "Update CHANGELOG for $(basename ${{ github.ref }})"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
delete-branch: true
title: "Update CHANGELOG"
body: |
Update CHANGELOG.md for new release