Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix release approval handling #5097

Merged
merged 3 commits into from
Jan 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/release-nethermind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ jobs:
update-homebrew:
name: Update Homebrew formula
runs-on: ubuntu-latest
needs: approval
needs: [approval, build]
if: needs.build.outputs.PRERELEASE == 'false'
steps:
- name: Restore packages from cache
Expand Down Expand Up @@ -145,7 +145,7 @@ jobs:
publish-github:
name: Publish to GitHub
runs-on: ubuntu-latest
needs: approval
needs: [approval, build]
steps:
- name: Restore packages from cache
uses: actions/cache@v3
Expand All @@ -166,7 +166,7 @@ jobs:
publish-downloads:
name: Publish to Downloads page
runs-on: ubuntu-latest
needs: approval
needs: [approval, build]
if: needs.build.outputs.PRERELEASE == 'false'
steps:
- name: Restore packages from cache
Expand All @@ -191,7 +191,7 @@ jobs:
publish-dockers:
name: Publish to Docker Hub
runs-on: ubuntu-latest
needs: approval
needs: [approval, build]
env:
DOCKER_IMAGE: nethermind/nethermind
steps:
Expand Down Expand Up @@ -225,7 +225,7 @@ jobs:
publish-ppa:
name: Publish to PPA
runs-on: ubuntu-latest
needs: approval
needs: [approval, build]
if: needs.build.outputs.PRERELEASE == 'false'
env:
PPA_GPG_KEYID: ${{ secrets.PPA_GPG_KEYID }}
Expand Down
4 changes: 2 additions & 2 deletions scripts/deployment/publish-downloads.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ do

curl https://downloads.nethermind.io/files?apikey=$DOWNLOADS_PAGE \
-X POST \
--fail-with-body \
-# \
-F "files=@$PWD/$FILE_NAME" \
-F "files=@$PWD/$FILE_NAME.asc" \
--fail
-F "files=@$PWD/$FILE_NAME.asc"
done

echo "Publishing completed"
25 changes: 21 additions & 4 deletions scripts/deployment/publish-github.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,27 @@ BODY=$(printf \

echo "Drafting release $GIT_TAG"

RELEASE_ID=$(curl https://api.github.com/repos/$GITHUB_REPOSITORY/releases \
-X POST \
RELEASE_ID=$(curl https://api.github.com/repos/$GITHUB_REPOSITORY/releases/tags/$GIT_TAG \
-X GET \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GITHUB_TOKEN" \
-d "$BODY" | jq -r '.id')
-H "Authorization: Bearer $GITHUB_TOKEN" | jq -r '.id')

if [ "$RELEASE_ID" == "null" ]
then
RELEASE_ID=$(curl https://api.github.com/repos/$GITHUB_REPOSITORY/releases \
-X POST \
--fail-with-body \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GITHUB_TOKEN" \
-d "$BODY" | jq -r '.id')
else
curl https://api.github.com/repos/$GITHUB_REPOSITORY/releases/$RELEASE_ID \
-X PATCH \
--fail-with-body \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GITHUB_TOKEN" \
-d "$BODY"
fi

cd $PACKAGE_PATH

Expand All @@ -30,6 +46,7 @@ do

curl https://uploads.github.com/repos/$GITHUB_REPOSITORY/releases/$RELEASE_ID/assets?name=$FILE_NAME \
-X POST \
--fail-with-body \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GITHUB_TOKEN" \
-H "Content-Type: application/octet-stream" \
Expand Down