Skip to content

Commit 56e98d5

Browse files
committed
Remove schedule and not related macaron changes
1 parent b7e9b16 commit 56e98d5

2 files changed

Lines changed: 10 additions & 39 deletions

File tree

.github/workflows/macaron-check-github-actions.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ on:
1717
- ".github/workflows/**"
1818
- ".github/actions/**"
1919
workflow_dispatch:
20-
schedule:
21-
- cron: "0 4 * * 3"
2220

2321
permissions:
2422
contents: read

.github/workflows/releasepublished.yml

Lines changed: 10 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ jobs:
6262
- name: Check credentials
6363
run: |
6464
set -e
65-
echo "Checking SonaType PORTAL_ACCESS_TOKEN"
66-
curl --fail -H "Accept:application/json" -H "Authorization: Bearer ${{ secrets.PORTAL_ACCESS_TOKEN }}" 'https://ossrh-staging-api.central.sonatype.com/manual/search/repositories?state=open'
65+
echo "Checking SonaType SONATYPE_BASIC_AUTH_CREDENTIALS"
66+
curl --fail -X GET -H "Content-Type:application/xml" -u "${{ secrets.SONATYPE_BASIC_AUTH_CREDENTIALS }}" https://oss.sonatype.org/service/local/staging/profiles/b39883a429024e > /dev/null
6767
echo "Checking GitHub ACCESS_TOKEN"
6868
curl -f -H "Authorization: Bearer ${{ secrets.ACCESS_TOKEN }}" -H 'Accept: application/vnd.github.v3.raw' -s https://api.github.com/repos/$REPO > /dev/null
6969
- name: Configure GPG key
@@ -88,7 +88,6 @@ jobs:
8888
env:
8989
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
9090
run: |
91-
sleep 900
9291
if [ "$RELEASE" = "latest" ]; then
9392
echo "Using latest release"
9493
set +e
@@ -142,7 +141,7 @@ jobs:
142141
mkdir unpacked
143142
cd unpacked
144143
unzip -q ../asset.zip
145-
head CHANGELOG.md
144+
head CHANGELOG.md
146145
- name: GPG sign all Maven files
147146
run: |
148147
cd unpacked/maven
@@ -158,11 +157,10 @@ jobs:
158157
# Code mostly by mezzargh
159158
set -e
160159
WD=`pwd`
161-
# we use the description field for cross identification between APIs (I could not find an alternative yet), so we can fetch correct repo for promotion.
162160
START_XML=$(cat << EOF
163161
<promoteRequest>
164162
<data>
165-
<description>${{github.repository}}-${{github.run_id}}-${{github.run_attempt}}</description>
163+
<description>Publish ${GITHUB_REPOSITORY} ${RELEASE} Artifacts</description>
166164
</data>
167165
</promoteRequest>
168166
EOF
@@ -173,43 +171,18 @@ jobs:
173171
cd unpacked/maven/repository
174172
cp $WD/start.xml start.xml
175173
cat start.xml
176-
curl -sS --fail -v -X POST -d @start.xml -H "Content-Type:application/xml" -H "Authorization: Bearer ${{ secrets.PORTAL_ACCESS_TOKEN }}" https://ossrh-staging-api.central.sonatype.com/service/local/staging/profiles/b39883a429024e/start -o $WD/finish.xml
174+
curl --fail -v -X POST -d @start.xml -H "Content-Type:application/xml" -u "${{ secrets.SONATYPE_BASIC_AUTH_CREDENTIALS }}" https://oss.sonatype.org/service/local/staging/profiles/b39883a429024e/start -o $WD/finish.xml
177175
rm start.xml
178-
curl --fail -H "Accept:application/json" -H "Authorization: Bearer ${{ secrets.PORTAL_ACCESS_TOKEN }}" 'https://ossrh-staging-api.central.sonatype.com/manual/search/repositories?state=open' -o results.json
179-
SELECTOR="${{github.repository}}-${{github.run_id}}-${{github.run_attempt}}"
180-
repository_namespace=`cat results.json | jq -jr --arg SELECTOR $SELECTOR ".repositories[] | select(.description == \"$SELECTOR\").key" | jq -jRrs "@uri"`
181-
echo $repository_namespace
182-
rm results.json
183176
ls -lahn $WD
184177
cat $WD/finish.xml
185178
staging_dir=$(echo $(awk -F '[<>]' '/stagedRepositoryId/{print $3}' $WD/finish.xml))
186-
rm $WD/finish.xml
187179
echo "Staging dir is '${staging_dir}'"
188180
find . -type f | sed -E s'@./@@' | grep -v start.xml > $WD/artifacts.list
189181
ls -lahn $WD
190182
echo "Uploading $(wc -l $WD/artifacts.list | sed "s/^ *\([0-9]*\) .*$/\1/") artifacts"
191183
awk '{printf "%5d\t%s\n", NR, $0}' < $WD/artifacts.list
192-
cat $WD/artifacts.list | xargs -n 1 -I {} curl -sS --fail -H "Authorization: Bearer ${{ secrets.PORTAL_ACCESS_TOKEN }}" --upload-file {} https://ossrh-staging-api.central.sonatype.com/service/local/staging/deployByRepositoryId/${staging_dir}/{}
193-
curl -s -X POST -H "Accept:application/json" -H "Authorization: Bearer ${{ secrets.PORTAL_ACCESS_TOKEN }}" https://ossrh-staging-api.central.sonatype.com/manual/upload/repository/${repository_namespace}?publishing_type=user_managed
194-
while [[ $(curl -sS --fail -H "Accept:application/json" -H "Authorization: Bearer ${{ secrets.PORTAL_ACCESS_TOKEN }}" 'https://ossrh-staging-api.central.sonatype.com/manual/search/repositories' | jq -r ".repositories[] | select(.description == \"$SELECTOR\").portal_deployment_id") == "null" ]]; do
195-
echo "Waiting for deployment ID...";
196-
curl -s -X POST -H "Accept:application/json" -H "Authorization: Bearer ${{ secrets.PORTAL_ACCESS_TOKEN }}" https://ossrh-staging-api.central.sonatype.com/manual/upload/repository/$repository_namespace?publishing_type=user_managed;
197-
sleep 5;
198-
done
199-
curl -sS --fail -H "Accept:application/json" -H "Authorization: Bearer ${{ secrets.PORTAL_ACCESS_TOKEN }}" 'https://ossrh-staging-api.central.sonatype.com/manual/search/repositories' -o final_result.json
200-
portal_id=`cat final_result.json | jq -jr ".repositories[] | select(.description == \"$SELECTOR\").portal_deployment_id"`
201-
echo "Closing OSSRH staging repo $repository_namespace, and continueing with Portal APIs"
202-
echo "Promotion to Portal deployment staging '$portal_id' is pending ...";
203-
while [[ $(curl -sS -X 'POST' -H 'Accept:application/json' -H "Authorization: Bearer ${{ secrets.PORTAL_ACCESS_TOKEN }}" "https://central.sonatype.com/api/v1/publisher/status?id=$portal_id" | jq -r '.deploymentState') == "PENDING" ]]; do
204-
echo "..."
205-
sleep 5;
206-
done
207-
echo "Validing Portal deployement ...";
208-
while [[ $(curl -sS -X 'POST' -H 'Accept:application/json' -H "Authorization: Bearer ${{ secrets.PORTAL_ACCESS_TOKEN }}" "https://central.sonatype.com/api/v1/publisher/status?id=$portal_id" | jq -r '.deploymentState') == "VALIDATING" ]]; do
209-
echo "..."
210-
sleep 5;
211-
done
212-
echo "Dropping OSSRH staging repo: $repository_namespace"
213-
curl -sS -X 'DELETE' -H "Authorization: Bearer ${{ secrets.PORTAL_ACCESS_TOKEN }}" https://ossrh-staging-api.central.sonatype.com/manual/drop/repository/$repository_namespace
214-
curl -sS -X 'POST' -H 'Accept:application/json' -H "Authorization: Bearer ${{ secrets.PORTAL_ACCESS_TOKEN }}" "https://central.sonatype.com/api/v1/publisher/status?id=$portal_id" | jq -e 'if .deploymentState == "FAILED" then error(.errors | tostring) else .deploymentState end'
215-
echo "Portal Staging repository: https://central.sonatype.com/api/v1/publisher/deployment/$portal_id/download/"
184+
cat $WD/artifacts.list | xargs -n 1 -I {} curl --fail -u "${{ secrets.SONATYPE_BASIC_AUTH_CREDENTIALS }}" --upload-file {} https://oss.sonatype.org/service/local/staging/deployByRepositoryId/${staging_dir}/{}
185+
cp $WD/finish.xml finish.xml
186+
cat finish.xml
187+
curl --fail -X POST -d @finish.xml -H "Content-Type:application/xml" -u "${{ secrets.SONATYPE_BASIC_AUTH_CREDENTIALS }}" -H "Content-Type:application/xml" https://oss.sonatype.org/service/local/staging/profiles/b39883a429024e/finish
188+
echo https://oss.sonatype.org/content/repositories/${staging_dir}

0 commit comments

Comments
 (0)