forked from hazelcast/rel-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (88 loc) · 3.62 KB
/
Copy pathpackage.yml
File metadata and controls
99 lines (88 loc) · 3.62 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
88
89
90
91
92
93
94
95
96
97
98
99
name: Package Hazelcast platform release metadata
description: Creates a draft PR for the updated release metadata, after adding the required Hazelcast platform release
run-name: ${{ github.workflow }} (`${{ inputs.VERSION }}`@${{ inputs.ENVIRONMENT }})
on:
# Called from release pipeline
workflow_dispatch:
inputs:
VERSION:
description: 'The version to release (e.g. `5.4.1`)'
required: true
RELEASE_TYPE:
description: 'What should be built'
required: true
type: choice
options:
- ALL
- OSS
- EE
ENVIRONMENT:
description: 'Environment to use'
required: true
type: environment
jobs:
package:
environment:
name: ${{ inputs.ENVIRONMENT }}
deployment: false
runs-on: ubuntu-slim
permissions:
contents: write
id-token: write
pull-requests: write
steps:
- uses: actions/checkout@v7
# Required to get the default branch as well, to allow `gh` to accurately determine the diff between branches when deriving PR title from commits
with:
fetch-depth: 0
- id: resolve-editions
uses: hazelcast/docker-actions/resolve-editions@master
with:
release-type: ${{ inputs.RELEASE_TYPE }}
- uses: hazelcast/docker-actions/get-jfrog-credentials@master
id: jfrog
with:
aws-role-to-assume: ${{ vars.AWS_HAZELCAST_OIDC_GITHUB_ACTIONS_ROLE_ARN }}
jfrog-oidc-provider-name: ${{ github.repository_owner }}-snapshot-internal
- name: Install dependencies
run: |
pip3 install -r .github/python/add-release/requirements.txt
- name: Update metadata
run: |
python3 .github/python/add-release/add_release.py \
--version=${VERSION} \
--github-org=${GITHUB_REPOSITORY_OWNER} \
--ee-release-repo-name=${{ vars.EE_RELEASE_REPO_NAME }} \
--jfrog-preprod-files-repo=${{ vars.JFROG_PREPROD_FILES_REPO }} \
--should-build-oss=${{ steps.resolve-editions.outputs.should_build_oss }} \
--should-build-ee=${{ steps.resolve-editions.outputs.should_build_ee }}
env:
VERSION: ${{ inputs.VERSION }}
RELEASE_REPO_USER: ${{ steps.jfrog.outputs.user }}
RELEASE_REPO_TOKEN: ${{ steps.jfrog.outputs.token }}
- uses: ./.github/actions/get-hazelcast-platform-pr-title
id: get-pr-title
with:
hz-version: ${{ inputs.VERSION }}
- name: Create PR for changes
run: |
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
# Make a new branch from the default one
# The default branch is the ultimate target of the PR, not the current one
# For _typical_ workflow execution this is the same
# But when testing changes, if running from the non-default branch (e.g. a branch with your workflow changes), the resultant version update PR will _also_ include those changes
git checkout \
-b "${{ github.job }}_run_${{ github.run_id }}" \
remotes/origin/${{ github.event.repository.default_branch }}
git commit \
--all \
--message="${{ steps.get-pr-title.outputs.title }}" \
--message="Generated by ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}."
git push -u origin HEAD
gh pr create \
--assignee "${GITHUB_ACTOR}" \
--fill \
--draft
env:
GH_TOKEN: ${{ github.token }}