Skip to content

Commit 5db69d9

Browse files
committed
Feat: Pin external references on a release
This pins references to external specs (distribution and runtime) to their latest release on a release of this project. Signed-off-by: Brandon Mitchell <git@bmitch.net>
1 parent da92727 commit 5db69d9

File tree

2 files changed

+35
-5
lines changed

2 files changed

+35
-5
lines changed

.tool/pin-release.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/sh
2+
3+
set -e
4+
cd "$(dirname $0)/.."
5+
6+
if [ ! -x "$(command -v curl )" ] || [ ! -x "$(command -v jq )" ] || [ ! -x "$(command -v find )" ] || [ ! -x "$(command -v sed )" ]; then
7+
echo "This command requires the following to run: curl, find, jq, and sed" >&2
8+
exit 1
9+
fi
10+
11+
runtime_tag=$(curl -L \
12+
-H "Accept: application/vnd.github+json" \
13+
-H "X-GitHub-Api-Version: 2022-11-28" \
14+
https://api.github.com/repos/opencontainers/runtime-spec/releases/latest \
15+
| jq -r .tag_name)
16+
17+
distribution_tag=$(curl -L \
18+
-H "Accept: application/vnd.github+json" \
19+
-H "X-GitHub-Api-Version: 2022-11-28" \
20+
https://api.github.com/repos/opencontainers/distribution-spec/releases/latest \
21+
| jq -r .tag_name)
22+
23+
find . -name '*.md' -exec sed -i \
24+
-e "s#https://github.com/opencontainers/runtime-spec/blob/main/#https://github.com/opencontainers/runtime-spec/blob/${runtime_tag}/#g" \
25+
-e "s#https://github.com/opencontainers/distribution-spec/blob/main/#https://github.com/opencontainers/distribution-spec/blob/${distribution_tag}/#g" \
26+
'{}' \;

RELEASES.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Maintainers MUST send updates to the <dev@opencontainers.org> with results of th
3434
Before the specification reaches v1.0.0, the meetings SHOULD be weekly.
3535
Once a specification has reached v1.0.0, the maintainers may alter the cadence, but a meeting MUST be held within four weeks of the previous meeting.
3636

37-
The release plans, corresponding milestones and estimated due dates MUST be published on GitHub (e.g. <https://github.com/opencontainers/runtime-spec/milestones>).
37+
The release plans, corresponding milestones and estimated due dates MUST be published on GitHub (e.g. <https://github.com/opencontainers/image-spec/milestones>).
3838
GitHub milestones and issues are only used for community organization and all releases MUST follow the [project governance](GOVERNANCE.md) rules and procedures.
3939

4040
### Timelines
@@ -53,18 +53,22 @@ Specifications have a variety of different timelines in their lifecycle.
5353
Releases usually follow a few steps:
5454

5555
- [ ] prepare a pull-request for the release
56-
- [ ] a commit updating `./ChangeLog`
56+
- [ ] generate a change log:
5757
- [ ] `git log --oneline --no-merges --decorate --name-status v1.0.1..HEAD | vim -`
5858
- [ ] `:% s/(pr\/\(\d*\))\(.*\)/\2 (#\1)/` to move the PR to the end of line and match previous formatting
5959
- [ ] review `(^M|^A|^D)` for impact of the commit
6060
- [ ] group commits to `Additions:`, `Minor fixes and documentation:`, `Breaking changes:`
6161
- [ ] delete the `(^M|^A|^D)` lines, `:%!grep -vE '(^M|^A|^D)'`
6262
- [ ] merge multi-commit PRs (so each line has a `(#num)` suffix)
6363
- [ ] drop hash and indent, `:'<,'> s/^\w* /^I* /`
64-
- [ ] a commit bumping `./specs-go/version.go` to next version and empty the `VersionDev` variable
65-
- [ ] a commit adding back the "+dev" to `VersionDev`
64+
- [ ] a commit for the release:
65+
- [ ] bump `./specs-go/version.go` to next version and empty the `VersionDev` variable
66+
- [ ] run `.tool/pin-release.sh` to pin the references to other specs
67+
- [ ] a commit to revert the main branch for development:
68+
- [ ] `git revert -n HEAD`
69+
- [ ] bump `./specs-go/version.go` to next version and set the `VersionDev` variable to `+dev`
6670
- [ ] send email to <dev@opencontainers.org>
67-
- [ ] copy the exact commit hash for bumping the version from the pull-request (since master always stays as "-dev")
71+
- [ ] copy the exact commit hash for bumping the version from the pull-request (since master always stays as "+dev")
6872
- [ ] count the PRs since last release (that this version is tracking, in the cases of multiple branching), like `git log --pretty=oneline --no-merges --decorate $priorTag..$versionBumpCommit | grep \(pr\/ | wc -l`
6973
- [ ] get the date for a week from now, like `TZ=UTC date --date='next week'`
7074
- [ ] OPTIONAL find a cute animal gif to attach to the email, and subsequently the release description

0 commit comments

Comments
 (0)