-
Notifications
You must be signed in to change notification settings - Fork 66
156 lines (134 loc) · 12.4 KB
/
publish-release-candidate-svn.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
name: Publish Release Candidate in ASF SVN
run-name: ${{ github.actor }} is publishing the Release Candidate on ASF SVN🚀
on:
workflow_dispatch:
inputs:
RC_TAG:
description: Release Candidate Tag (release-x.xx-RCx)
required: true
APACHE_ID:
description: Your Apache id
required: true
APACHE_PASSWORD:
description: Your Apache password
required: true
jobs:
finalizeReleaseCandidateInSVN:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/[email protected]
with:
ref: ${{ github.event.inputs.RC_TAG }}
- name: Get Maven POM version
id: standardMavenVersion
run: echo "version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT
- name: Extract branch name
id: branchExtracted
shell: bash
run: echo "name=${{ github.event.inputs.RC_TAG }}" >> $GITHUB_OUTPUT
- name: Extract Release Candidate revision
id: rcRevision
run: |
rcRevision="${{ github.event.inputs.RC_TAG }}"
set -- $rcRevision
echo "version=${1##*-}" >> $GITHUB_OUTPUT
- name: Extract branch without release prefix
id: branchWithoutPrefixExtracted
run: |
branchWithoutPrefixExtracted="${{ github.event.inputs.RC_TAG }}"
set -- $branchWithoutPrefixExtracted
echo "version=${1#*-*}" >> $GITHUB_OUTPUT
- name: Download artifacts from GitHub and Upload artifacts into ASF SVN
run: |
svn co https://dist.apache.org/repos/dist/dev/manifoldcf
mkdir -p apache-manifoldcf-${{ steps.branchExtracted.outputs.name }}
cd apache-manifoldcf-${{ steps.branchExtracted.outputs.name }}
if (svn ls "apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-dev-bin.zip"); then
echo "Removing existing apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-dev-bin.zip"
svn delete "apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-dev-bin.zip"
fi
if (svn ls "apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-dev-bin.tar.gz"); then
echo "Removing existing apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-dev-bin.tar.gz"
svn delete "apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-dev-bin.tar.gz"
fi
if (svn ls "apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-dev-lib.tar.gz"); then
echo "Removing existing apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-dev-lib.tar.gz"
svn delete "apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-dev-lib.tar.gz"
fi
if (svn ls "apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-dev-lib.zip"); then
echo "Removing existing apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-dev-lib.zip"
svn delete "apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-dev-lib.zip"
fi
if (svn ls "apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-dev-src.tar.gz"); then
echo "Removing existing apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-dev-src.tar.gz"
svn delete "apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-dev-src.tar.gz"
fi
if (svn ls "apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-dev-src.zip"); then
echo "Removing existing apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-dev-src.zip"
svn delete "apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-dev-src.zip"
fi
echo "Downloading: https://github.com/apache/manifoldcf/releases/download/${{ steps.branchWithoutPrefixExtracted.outputs.version }}/apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-dev-bin.zip"
wget https://github.com/apache/manifoldcf/releases/download/${{ steps.branchWithoutPrefixExtracted.outputs.version }}/apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-dev-bin.zip -O "apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-dev-bin.zip"
echo "Downloading: https://github.com/apache/manifoldcf/releases/download/${{ steps.branchWithoutPrefixExtracted.outputs.version }}/apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-dev-bin.tar.gz"
wget https://github.com/apache/manifoldcf/releases/download/${{ steps.branchWithoutPrefixExtracted.outputs.version }}/apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-dev-bin.tar.gz -O "apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-dev-bin.tar.gz"
echo "Downloading: https://github.com/apache/manifoldcf/releases/download/${{ steps.branchWithoutPrefixExtracted.outputs.version }}/apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-dev-lib.tar.gz"
wget https://github.com/apache/manifoldcf/releases/download/${{ steps.branchWithoutPrefixExtracted.outputs.version }}/apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-dev-lib.tar.gz -O "apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-dev-lib.tar.gz"
echo "Downloading: https://github.com/apache/manifoldcf/releases/download/${{ steps.branchWithoutPrefixExtracted.outputs.version }}/apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-dev-lib.zip"
wget https://github.com/apache/manifoldcf/releases/download/${{ steps.branchWithoutPrefixExtracted.outputs.version }}/apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-dev-lib.zip -O "apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-dev-lib.zip"
echo "Downloading: https://github.com/apache/manifoldcf/releases/download/${{ steps.branchWithoutPrefixExtracted.outputs.version }}/apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-dev-src.tar.gz"
wget https://github.com/apache/manifoldcf/releases/download/${{ steps.branchWithoutPrefixExtracted.outputs.version }}/apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-dev-src.tar.gz -O "apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-dev-src.tar.gz"
echo "Downloading: https://github.com/apache/manifoldcf/releases/download/${{ steps.branchWithoutPrefixExtracted.outputs.version }}/apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-dev-src.zip"
wget https://github.com/apache/manifoldcf/releases/download/${{ steps.branchWithoutPrefixExtracted.outputs.version }}/apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-dev-src.zip -O "apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-dev-src.zip"
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@111c56156bcc6918c056dbef52164cfa583dc549
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Mask Apache Password
run: |
# Workaround for Actions bug - https://github.com/actions/runner/issues/643
APACHE_PASS=$(jq -r '.inputs.APACHE_PASSWORD' $GITHUB_EVENT_PATH)
echo "::add-mask::$APACHE_PASS"
- name: Generate file hashes
run: |
echo "$GPG_PRIVATE_KEY" | gpg --batch --import --passphrase "$GPG_PASSPHRASE"
gpg --local-user "${{steps.import_gpg.outputs.name}}" --armor --output apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-src.zip.asc --detach-sig apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-src.zip
gpg --local-user "${{steps.import_gpg.outputs.name}}" --armor --output apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-src.tar.gz.asc --detach-sig apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-src.tar.gz
gpg --local-user "${{steps.import_gpg.outputs.name}}" --armor --output apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-lib.zip.asc --detach-sig apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-lib.zip
gpg --local-user "${{steps.import_gpg.outputs.name}}" --armor --output apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-lib.tar.gz.asc --detach-sig apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-lib.tar.gz
gpg --local-user "${{steps.import_gpg.outputs.name}}" --armor --output apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-bin.zip.asc --detach-sig apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-bin.zip
gpg --local-user "${{steps.import_gpg.outputs.name}}" --armor --output apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-bin.tar.gz.asc --detach-sig apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-bin.tar.gz
gpg --print-md MD5 apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-src.zip > apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-src.zip.md5
gpg --print-md MD5 apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-src.tar.gz > apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-src.tar.gz.md5
gpg --print-md MD5 apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-lib.zip > apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-lib.zip.md5
gpg --print-md MD5 apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-lib.tar.gz > apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-lib.tar.gz.md5
gpg --print-md MD5 apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-bin.zip > apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-bin.zip.md5
gpg --print-md MD5 apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-bin.tar.gz > apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-bin.tar.gz.md5
gpg --print-md SHA512 apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-src.zip > apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-src.zip.sha512
gpg --print-md SHA512 apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-src.tar.gz > apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-src.tar.gz.sha512
gpg --print-md SHA512 apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-lib.zip > apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-lib.zip.sha512
gpg --print-md SHA512 apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-lib.tar.gz > apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-lib.tar.gz.sha512
gpg --print-md SHA512 apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-bin.zip > apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-bin.zip.sha512
gpg --print-md SHA512 apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-bin.tar.gz > apache-manifoldcf-${{steps.standardMavenVersion.outputs.version}}-bin.tar.gz.sha512
svn add --force .
svn status
svn commit -m "Create ${{ steps.rcRevision.outputs.version }} for MCF ${{ steps.artifactVersion.outputs.version }}"
svn commit -m "Staging Apache ManifoldCF ${{ steps.artifactVersion.outputs.version }}" --non-interactive --username "${{ github.event.inputs.APACHE_ID }}" --password "${{ github.event.inputs.APACHE_PASSWORD }}"