-
Notifications
You must be signed in to change notification settings - Fork 2
60 lines (51 loc) · 1.58 KB
/
release-test.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 Test Workflow
on:
push:
branches-ignore:
- latest
jobs:
test-pipeline:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
# Checkout code
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
# Get branch name
- name: Get branch name
id: get_branch
run: echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
# Update GitVersion config to emulate "latest" branch release
- name: Update GitVersion Config In-Place
run: |
sed -i "s/__BRANCH_NAME__/$BRANCH_NAME/g" ci/git-version.yml
# Debug GitVersion Config - Print updated configuration
- name: Debug GitVersion Config
run: cat ci/git-version.yml
# Install GitVersion
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: "6.0.0"
# Determine Version using GitVersion
- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/[email protected]
with:
useConfigFile: true
configFilePath: ci/git-version.yml
# Generate changelog
- name: Generate changelog
id: changelog
run: |
git log $(git describe --tags --abbrev=0)..HEAD -- . \
--pretty=format:"- %s" > changelog.txt
CHANGELOG=$(cat changelog.txt | jq -sRr @uri)
echo "changelog<<EOF" >> $GITHUB_ENV
echo "$CHANGELOG" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV