-
Notifications
You must be signed in to change notification settings - Fork 6
103 lines (86 loc) · 3.25 KB
/
core-prepare-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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: Prepare Release
on:
workflow_call:
inputs:
version:
description: the version to be released. If it ends with '.0' a proper release is created, bugfix otherwise
required: true
type: string
jobs:
Prepare-Release:
runs-on: ubuntu-latest
outputs:
RELEASE_REF: ${{ steps.commit-changes.outputs.RELEASE_REF }}
steps:
- uses: actions/checkout@v4
- name: set release type
shell: bash
id: vars
run: |
type=bugfix
if [[ ${{ inputs.version }} == *0 ]]
then
type=release
fi
echo "type=$type" >> $GITHUB_OUTPUT
- uses: eclipse-edc/.github/.github/actions/generate-dependencies-file@main
with:
run: strict
- name: Replace published DEPENDENCIES file link in NOTICE with the one just created
run: sed -i "s#\[DEPENDENCIES\]\(.*\)#\[DEPENDENCIES\]\(DEPENDENCIES\)#g" NOTICE.md
- uses: eclipse-edc/.github/.github/actions/set-project-version@main
with:
version: ${{ inputs.version }}-SNAPSHOT
- name: Commit changes on ${{ steps.vars.outputs.type }}/${{ inputs.version }} branch
shell: bash
id: commit-changes
run: |
git config user.name "eclipse-edc-bot"
git config user.email "[email protected]"
RELEASE_REF=${{ steps.vars.outputs.type }}/${{ inputs.version }}
git checkout -b $RELEASE_REF
git add .
git commit -m "Prepare ${{ steps.vars.outputs.type }} ${{ inputs.version }}"
git push origin $RELEASE_REF
echo "RELEASE_REF=$RELEASE_REF" >> $GITHUB_OUTPUT
Bump-Main-Version:
if: github.ref_name == 'main'
needs: [ Prepare-Release ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: main
- uses: eclipse-edc/.github/.github/actions/bump-version@main
with:
base_version: ${{ inputs.version }}
Publish-Main-Snapshot:
# publish snapshot artifacts for the next x.y.0 version
if: github.ref_name == 'main'
needs: [ Bump-Main-Version ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: main
- uses: eclipse-edc/.github/.github/actions/publish-maven-artifacts@main
with:
gpg-private-key: ${{ secrets.ORG_GPG_PRIVATE_KEY }}
gpg-passphrase: ${{ secrets.ORG_GPG_PASSPHRASE }}
osshr-username: ${{ secrets.ORG_OSSRH_USERNAME }}
osshr-password: ${{ secrets.ORG_OSSRH_PASSWORD }}
Publish-Bugfix-Snapshot:
# publish snapshot artifacts from the bugfix branch (RELEASE_REF) only for bugfix releases (that does not start from main)
if: github.ref_name != 'main'
needs: [ Prepare-Release ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.Prepare-Release.outputs.RELEASE_REF }}
- uses: eclipse-edc/.github/.github/actions/publish-maven-artifacts@main
with:
gpg-private-key: ${{ secrets.ORG_GPG_PRIVATE_KEY }}
gpg-passphrase: ${{ secrets.ORG_GPG_PASSPHRASE }}
osshr-username: ${{ secrets.ORG_OSSRH_USERNAME }}
osshr-password: ${{ secrets.ORG_OSSRH_PASSWORD }}