Skip to content
This repository was archived by the owner on Aug 29, 2023. It is now read-only.

Commit 0ee771b

Browse files
committed
Merge remote-tracking branch 'origin/master' into sync-release-assets
2 parents 0f14645 + 0ca4a50 commit 0ee771b

File tree

2 files changed

+46
-33
lines changed

2 files changed

+46
-33
lines changed

.github/workflows/release-check.yml

Lines changed: 42 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# This workflow cannot post sticky comments on PRs from forked repositories.
2+
# Instead, it outputs the message it would have posted as a workflow notice.
3+
# See https://github.com/protocol/.github/issues/254 for details.
4+
15
name: Release Checker
26
on: [ workflow_call ]
37

@@ -30,7 +34,7 @@ jobs:
3034
read -ra arr <<< $(git diff-index ${{ github.event.pull_request.base.sha }} -- version.json)
3135
status=0
3236
git rev-list $VERSION &> /dev/null || status=$?
33-
if [[ "${arr[4]}" == "A" && $status == 0 ]]; then
37+
if [[ "${arr[4]}" == "A" && $status == 0 ]]; then
3438
echo "INITIAL_RUN=true" >> $GITHUB_ENV
3539
fi
3640
- name: Install semver (node command line tool)
@@ -41,7 +45,7 @@ jobs:
4145
run: semver ${{ env.VERSION }} # fails if the version is not a valid semver version (e.g. v0.1 would fail)
4246
- name: Determine version number to compare to
4347
if: env.INITIAL_RUN == 'false'
44-
# We need to determine the version number we want to compare to,
48+
# We need to determine the version number we want to compare to,
4549
# taking into account that this might be a (patch) release on a release branch.
4650
# Example:
4751
# Imagine a module that has releases for v0.1.0, v0.2.0 and v0.3.0.
@@ -71,10 +75,10 @@ jobs:
7175
if: env.INITIAL_RUN == 'false' && env.COMPARETO != ''
7276
run: |
7377
# First get the diff for the go.mod file in the root directory...
74-
output=$(git diff ${{ env.COMPARETO }}..${{ github.event.pull_request.head.sha }} -- './go.mod')
78+
output=$(git diff ${{ env.COMPARETO }}..HEAD -- './go.mod')
7579
# ... then get the diff for all go.mod files in subdirectories.
76-
# Note that this command also finds go.mod files more than one level deep in the directory structure.
77-
output+=$(git diff ${{ env.COMPARETO }}..${{ github.event.pull_request.head.sha }} -- '*/go.mod')
80+
# Note that this command also finds go.mod files more than one level deep in the directory structure.
81+
output+=$(git diff ${{ env.COMPARETO }}..HEAD -- '*/go.mod')
7882
if [[ -z "$output" ]]; then
7983
output="(empty)"
8084
fi
@@ -90,7 +94,7 @@ jobs:
9094
if: env.INITIAL_RUN == 'false' && env.COMPARETO != ''
9195
run: |
9296
go install github.com/smola/gocompat/cmd/gocompat@8498b97a44792a3a6063c47014726baa63e2e669 # v0.3.0
93-
output=$(gocompat compare --go1compat --git-refs="${{ env.COMPARETO }}..${{ github.event.pull_request.head.sha }}" ./... || true)
97+
output=$(gocompat compare --go1compat --git-refs="${{ env.COMPARETO }}..HEAD" ./... || true)
9498
if [[ -z "$output" ]]; then
9599
output="(empty)"
96100
fi
@@ -104,29 +108,39 @@ jobs:
104108
If you wish to cut a release once this PR is merged, please add the \`release\` label to this PR.
105109
EOF" >> $GITHUB_ENV
106110
if: github.base_ref != github.event.repository.default_branch
107-
- name: Post output
108-
uses: marocchino/sticky-pull-request-comment@82e7a0d3c51217201b3fedc4ddde6632e969a477 # v2.1.1
111+
- run: |
112+
echo 'MESSAGE<<EOF
113+
Suggested version: `${{ env.VERSION }}`
114+
Comparing to: [`${{ env.COMPARETO }}`](${{ github.event.pull_request.base.repo.html_url }}/releases/tag/${{ env.COMPARETO }}) ([diff](${{ github.event.pull_request.base.repo.html_url }}/compare/${{ env.COMPARETO }}..${{ github.event.pull_request.head.label }}))
115+
116+
Changes in `go.mod` file(s):
117+
```diff
118+
${{ env.GOMODDIFF }}
119+
```
120+
121+
`gorelease` says:
122+
```
123+
${{ env.GORELEASE }}
124+
```
125+
126+
`gocompat` says:
127+
```
128+
${{ env.GOCOMPAT }}
129+
```
130+
${{ env.RELEASE_BRANCH_NOTE }}
131+
EOF' >> $GITHUB_ENV
109132
if: env.INITIAL_RUN == 'false' && env.COMPARETO != ''
133+
- name: Post message on PR
134+
uses: marocchino/sticky-pull-request-comment@82e7a0d3c51217201b3fedc4ddde6632e969a477 # v2.1.1
135+
if: env.INITIAL_RUN == 'false' && env.COMPARETO != '' && github.event.pull_request.head.repo.full_name == github.repository
110136
with:
111137
header: release-check
112138
recreate: true
113-
message: |
114-
Suggested version: `${{ env.VERSION }}`
115-
Comparing to: [`${{ env.COMPARETO }}`](${{ github.event.pull_request.base.repo.html_url }}/releases/tag/${{ env.COMPARETO }}) ([diff](${{ github.event.pull_request.base.repo.html_url }}/compare/${{ env.COMPARETO }}..${{ github.event.pull_request.head.ref }}))
116-
117-
Changes in `go.mod` file(s):
118-
```diff
119-
${{ env.GOMODDIFF }}
120-
```
121-
122-
`gorelease` says:
123-
```
124-
${{ env.GORELEASE }}
125-
```
126-
127-
`gocompat` says:
128-
```
129-
${{ env.GOCOMPAT }}
130-
```
131-
${{ env.RELEASE_BRANCH_NOTE }}
132-
139+
message: ${{ env.MESSAGE }}
140+
- name: Set a notice message on run
141+
run: |
142+
message="${MESSAGE//'%'/'%25'}"
143+
message="${message//$'\n'/'%0A'}"
144+
message="${message//$'\r'/'%0D'}"
145+
echo "::notice ::$message"
146+
if: env.INITIAL_RUN == 'false' && env.COMPARETO != '' && github.event.pull_request.head.repo.full_name != github.repository

configs/go.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
{ "target": "ipfs/go-ds-badger" },
4242
{ "target": "ipfs/go-ds-badger2" },
4343
{ "target": "ipfs/go-ds-bitcask" },
44-
{ "target": "ipfs/go-ds-crdt" },
4544
{ "target": "ipfs/go-ds-flatfs" },
4645
{ "target": "ipfs/go-ds-leveldb" },
4746
{ "target": "ipfs/go-ds-measure" },
@@ -59,7 +58,9 @@
5958
".github/workflows/automerge.yml",
6059
".github/workflows/sync-release-assets.yml"
6160
],
62-
"dist": "go-ipfs"
61+
"dist": "go-ipfs",
62+
"deploy_versioning": false,
63+
"deploy_go": false
6364
},
6465
{ "target": "ipfs/go-ipfs-api" },
6566
{ "target": "ipfs/go-ipfs-blockstore" },
@@ -121,7 +122,6 @@
121122
{ "target": "ipld/go-storethehash" },
122123
{ "target": "libp2p/dht-tracer1" },
123124
{ "target": "libp2p/dht-utils" },
124-
{ "target": "libp2p/go-addr-util" },
125125
{ "target": "libp2p/go-buffer-pool" },
126126
{ "target": "libp2p/go-cidranger" },
127127
{ "target": "libp2p/go-composable-routing" },
@@ -131,7 +131,6 @@
131131
{ "target": "libp2p/go-flow-metrics" },
132132
{ "target": "libp2p/go-libp2p" },
133133
{ "target": "libp2p/go-libp2p-asn-util" },
134-
{ "target": "libp2p/go-libp2p-autonat" },
135134
{ "target": "libp2p/go-libp2p-backoff" },
136135
{ "target": "libp2p/go-libp2p-blankhost" },
137136
{ "target": "libp2p/go-libp2p-circuit" },
@@ -149,7 +148,6 @@
149148
{ "target": "libp2p/go-libp2p-loggables" },
150149
{ "target": "libp2p/go-libp2p-mplex" },
151150
{ "target": "libp2p/go-libp2p-nat" },
152-
{ "target": "libp2p/go-libp2p-netutil" },
153151
{ "target": "libp2p/go-libp2p-noise" },
154152
{ "target": "libp2p/go-libp2p-peerstore" },
155153
{ "target": "libp2p/go-libp2p-pnet" },
@@ -165,6 +163,7 @@
165163
],
166164
"dist": "libp2p-relay-daemon"
167165
},
166+
{ "target": "libp2p/go-libp2p-resource-manager" },
168167
{ "target": "libp2p/go-libp2p-routing-helpers" },
169168
{ "target": "libp2p/go-libp2p-swarm" },
170169
{ "target": "libp2p/go-libp2p-testing" },

0 commit comments

Comments
 (0)