Skip to content

Commit 1a54c76

Browse files
committed
Revert manual release changes
1 parent 063d714 commit 1a54c76

File tree

1 file changed

+46
-52
lines changed

1 file changed

+46
-52
lines changed

.github/workflows/release.yml

Lines changed: 46 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,16 @@ jobs:
3232
- name: 'Build ARM image to Docker Hub'
3333
id: build
3434
run: |
35-
echo "skipping..."
36-
# output_dir=${{ runner.temp }}/docker
37-
# mkdir -p $output_dir
38-
# docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_ACCESS_TOKEN }}
39-
# docker buildx build --push --platform linux/amd64,linux/arm64 -t ${{ secrets.DOCKER_REPO }}:latest -t ${{ secrets.DOCKER_REPO }}:${{ steps.extract.outputs.image_tag }} -t ${{ secrets.DOCKER_REPO }}:${{ steps.extract.outputs.image_tag_minor_latest }} .
35+
output_dir=${{ runner.temp }}/docker
36+
mkdir -p $output_dir
37+
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_ACCESS_TOKEN }}
38+
docker buildx build --push --platform linux/amd64,linux/arm64 -t ${{ secrets.DOCKER_REPO }}:latest -t ${{ secrets.DOCKER_REPO }}:${{ steps.extract.outputs.image_tag }} -t ${{ secrets.DOCKER_REPO }}:${{ steps.extract.outputs.image_tag_minor_latest }} .
4039
build-binary:
4140
name: 'Build binary for ${{ matrix.os }}'
4241
strategy:
4342
fail-fast: false
4443
matrix:
45-
# os: [ "ubuntu-20.04", "macos-latest" ]
46-
os: [ "macos-latest" ]
44+
os: [ "ubuntu-20.04", "macos-latest" ]
4745
runs-on: ${{ matrix.os }}
4846
steps:
4947
- name: 'Setup Go ${{ env.GO_VERSION }}'
@@ -55,8 +53,7 @@ jobs:
5553
run: |
5654
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
5755
echo "::set-output name=key::$(go env GOOS)_$(go env GOARCH)"
58-
echo "::set-output name=version::v24.4.0"
59-
# echo "::set-output name=version::${GITHUB_REF##*/}"
56+
echo "::set-output name=version::${GITHUB_REF##*/}"
6057
- name: 'Check out project files'
6158
uses: actions/checkout@v2
6259
with:
@@ -106,16 +103,14 @@ jobs:
106103
strategy:
107104
fail-fast: false
108105
matrix:
109-
# goarch: [ "linux_amd64", "darwin_arm64" ]
110-
goarch: [ "darwin_arm64" ]
106+
goarch: [ "linux_amd64", "darwin_arm64" ]
111107
runs-on: ubuntu-latest
112108
steps:
113109
- name: 'Prepare environment'
114110
id: env
115111
run: |
116112
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
117-
echo "::set-output name=version::v24.4.0"
118-
# echo "::set-output name=version::${GITHUB_REF##*/}"
113+
echo "::set-output name=version::${GITHUB_REF##*/}"
119114
- name: 'Download artifacts'
120115
uses: actions/download-artifact@v2
121116
with:
@@ -147,45 +142,44 @@ jobs:
147142
- name: 'Generate release notes'
148143
id: release_notes
149144
run: |
150-
echo "skipping..."
151-
# git fetch --depth=1 origin +refs/tags/*:refs/tags/*
152-
# file="generated-release-notes.md"
153-
# current_version="${GITHUB_REF##*/}"
154-
# last_version=$(git describe --abbrev=0 --tags `git rev-list --tags --skip=1 --max-count=1`)
155-
# last_release_date=$(git log -1 --format=%cd --date=short $last_version)
156-
# echo "Last version: $last_version on $last_release_date"
157-
# # pulling from git logs
158-
# curl -q -s -H "Accept: application/vnd.github.v3+json" \
159-
# "https://api.github.com/search/issues?q=repo:ConsenSys/quorum+is:pr+is:merged+merged%3A>=$last_release_date+sort%3Aupdated-desc" | jq -r '"* " + (.items[]|.title + " #" + (.number|tostring))' \
160-
# >> $file
161-
# # pulling file hashes from Cloudsmith
162-
# echo "" >> $file
163-
# echo "| Filename | SHA256 Hash |" >> $file
164-
# echo "|:---------|:------------|" >> $file
165-
# curl --request GET \
166-
# --url "https://api.cloudsmith.io/v1/packages/consensys/go-quorum/?query=version:$current_version" \
167-
# --header 'Accept: application/json' \
168-
# --header 'X-Api-Key: ${{ secrets.CLOUDSMITH_API_KEY }}' \
169-
# | jq '.[] | select(.name | endswith(".asc") | not) | "|[\(.name)](\(.cdn_url))|`\(.checksum_sha256)`|"' -r \
170-
# >> $file
171-
# content=$(cat $file)
172-
# # escape newline
173-
# content="${content//'%'/'%25'}"
174-
# content="${content//$'\n'/'%0A'}"
175-
# content="${content//$'\r'/'%0D'}"
176-
# echo "::set-output name=content::$content"
177-
# - name: 'Create Github draft release'
178-
# uses: actions/create-release@v1
179-
# env:
180-
# # This token is provided by Actions, you do not need to create your own token
181-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
182-
# with:
183-
# tag_name: ${{ github.ref }}
184-
# release_name: ${{ github.ref }}
185-
# body: |
186-
# ${{ steps.release_notes.outputs.content }}
187-
# draft: true
188-
# prerelease: false
145+
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
146+
file="generated-release-notes.md"
147+
current_version="${GITHUB_REF##*/}"
148+
last_version=$(git describe --abbrev=0 --tags `git rev-list --tags --skip=1 --max-count=1`)
149+
last_release_date=$(git log -1 --format=%cd --date=short $last_version)
150+
echo "Last version: $last_version on $last_release_date"
151+
# pulling from git logs
152+
curl -q -s -H "Accept: application/vnd.github.v3+json" \
153+
"https://api.github.com/search/issues?q=repo:ConsenSys/quorum+is:pr+is:merged+merged%3A>=$last_release_date+sort%3Aupdated-desc" | jq -r '"* " + (.items[]|.title + " #" + (.number|tostring))' \
154+
>> $file
155+
# pulling file hashes from Cloudsmith
156+
echo "" >> $file
157+
echo "| Filename | SHA256 Hash |" >> $file
158+
echo "|:---------|:------------|" >> $file
159+
curl --request GET \
160+
--url "https://api.cloudsmith.io/v1/packages/consensys/go-quorum/?query=version:$current_version" \
161+
--header 'Accept: application/json' \
162+
--header 'X-Api-Key: ${{ secrets.CLOUDSMITH_API_KEY }}' \
163+
| jq '.[] | select(.name | endswith(".asc") | not) | "|[\(.name)](\(.cdn_url))|`\(.checksum_sha256)`|"' -r \
164+
>> $file
165+
content=$(cat $file)
166+
# escape newline
167+
content="${content//'%'/'%25'}"
168+
content="${content//$'\n'/'%0A'}"
169+
content="${content//$'\r'/'%0D'}"
170+
echo "::set-output name=content::$content"
171+
- name: 'Create Github draft release'
172+
uses: actions/create-release@v1
173+
env:
174+
# This token is provided by Actions, you do not need to create your own token
175+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
176+
with:
177+
tag_name: ${{ github.ref }}
178+
release_name: ${{ github.ref }}
179+
body: |
180+
${{ steps.release_notes.outputs.content }}
181+
draft: true
182+
prerelease: false
189183
notify:
190184
if: always()
191185
name: 'Notify'

0 commit comments

Comments
 (0)