Skip to content

Commit 4e2b9cf

Browse files
committed
Finalize Release Workflow
1 parent 0dd92be commit 4e2b9cf

File tree

5 files changed

+38
-501
lines changed

5 files changed

+38
-501
lines changed

.github/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ out of date. Examples are listed on
2929

3030
To build and install tmux from a release tarball, use:
3131

32-
```bash
32+
~~~bash
3333
./configure && make
3434
sudo make install
35-
```
35+
~~~
3636

3737
tmux can use the utempter library to update utmp(5), if it is installed - run
3838
configure with `--enable-utempter` to enable this.
@@ -45,12 +45,12 @@ For more detailed instructions on building and installing tmux, see
4545
To get and build the latest from version control - note that this requires
4646
`autoconf`, `automake` and `pkg-config`:
4747

48-
```bash
48+
~~~bash
4949
git clone https://github.com/tmux/tmux.git
5050
cd tmux
5151
sh autogen.sh
5252
./configure && make
53-
```
53+
~~~
5454

5555
## Contributing
5656

@@ -71,9 +71,9 @@ further information.
7171
For documentation on using tmux, see the tmux.1 manpage. View it from the
7272
source tree with:
7373

74-
```bash
74+
~~~bash
7575
nroff -mdoc tmux.1|less
76-
```
76+
~~~
7777

7878
A small example configuration is in `example_tmux.conf`.
7979

.github/workflows/tagged-release.yml

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "tagged-release"
1+
name: Tagged Release
22

33
on:
44
push:
@@ -39,7 +39,7 @@ jobs:
3939
./$test_script
4040
done
4141
42-
- name: "Remove next- prefix from version in configure.ac"
42+
- name: Remove next- prefix from version in configure.ac
4343
run: |
4444
sed -i '/AC_INIT(\[tmux\], /s/next-//' configure.ac
4545
make dist
@@ -63,10 +63,16 @@ jobs:
6363
- name: Add to CHANGES
6464
id: add_to_changes
6565
run: |
66-
PREV_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
67-
68-
# get all committed changes since last release
69-
git log --pretty=format:'%s' $PREV_TAG..HEAD > /tmp/tmux-tagged-release
66+
LAST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
67+
PREV_TAG=${LAST_TAG:none}
68+
if [ "$(git tag | wc -l)" -eq "0" ]
69+
then
70+
# get all committed changes
71+
git log --pretty=format:'%s' > /tmp/tmux-tagged-release
72+
else
73+
# get all committed changes since last release
74+
git log --pretty=format:'%s' $PREV_TAG..HEAD > /tmp/tmux-tagged-release
75+
fi
7076
7177
# format the commit messages and add to CHANGES file
7278
sed 's/^/* /' /tmp/tmux-tagged-release > /tmp/tmp_file
@@ -79,7 +85,7 @@ jobs:
7985
git commit -m "Add to CHANGES for new release"
8086
git push
8187
82-
- name: "Create and push tag"
88+
- name: Create and push tag
8389
run: |
8490
git tag -a "v$VERSION" -m "Release v$VERSION"
8591
git push origin "v$VERSION"
@@ -93,10 +99,24 @@ jobs:
9399
*.tar.gz
94100
id: "automatic_releases"
95101

102+
- name: Update next version number
103+
run: |
104+
IFS='.' read -ra VER <<< "$VERSION"
105+
NEW_PATCH=$((VER[2]+1))
106+
NEW_VERSION="${VER[0]}.${VER[1]}.$NEW_PATCH"
107+
108+
# Write back to file
109+
sed -i "s/AC_INIT(\[tmux\], $VERSION)/AC_INIT([tmux], next-$NEW_VERSION)/" configure.ac
110+
111+
git add configure.ac
112+
git commit -m "Bump version to next-$NEW_VERSION"
113+
git push origin HEAD
114+
96115
- name: Create new release issue
97116
run: |
117+
gh label create -f $LABEL
98118
previous_issue_number=$(gh issue list \
99-
--label "$LABELS" \
119+
--label "$LABEL" \
100120
--json number \
101121
--jq '.[0].number')
102122
@@ -107,13 +127,14 @@ jobs:
107127
108128
new_issue_url=$(gh issue create \
109129
--title "$NEW_TAG questions and comments" \
110-
--label "release" \
130+
--label "$LABEL" \
111131
--body "$BODY")
112132
113133
echo "ISSUE_URL=$new_issue_url" >> $GITHUB_ENV
114134
env:
115135
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
116136
GH_REPO: ${{ github.repository }}
137+
LABEL: release
117138
BODY: |
118139
Ask or discuss any quick questions about ${{ env.NEW_TAG }} here please.
119140
Do not use this issue for bug reports, please open a new issue with full information, see [CONTRIBUTING](${{ env.BASE_URL }}/blob/master/.github/CONTRIBUTING.md).
@@ -122,23 +143,10 @@ jobs:
122143
123144
As always, thanks to the many people who contributed to both this and to previous releases.
124145
125-
- name: "Update Release Notes"
146+
- name: Update release notes
126147
run: |
127148
gh release edit $NEW_TAG -n "$RELEASE_NOTE"
128149
env:
129150
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
130151
RELEASE_NOTE: |
131152
For a list of changes [please read the CHANGES file](${{ env.BASE_URL }}/blob/master/CHANGES); for release notes [please see this issue](${{ env.ISSUE_URL }})
132-
133-
- name: "Update next version number"
134-
run: |
135-
IFS='.' read -ra VER <<< "$VERSION"
136-
NEW_PATCH=$((VER[2]+1))
137-
NEW_VERSION="${VER[0]}.${VER[1]}.$NEW_PATCH"
138-
139-
# Write back to file
140-
sed -i "s/AC_INIT(\[tmux\], $VERSION)/AC_INIT([tmux], next-$NEW_VERSION)/" configure.ac
141-
142-
git add configure.ac
143-
git commit -m "Bump version to next-$NEW_VERSION"
144-
git push origin HEAD

0 commit comments

Comments
 (0)