forked from mfaerevaag/wd
-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (36 loc) · 1.13 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: release
on:
workflow_dispatch:
inputs:
version:
description: "Version of the release"
required: true
type: string
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v4
- name: process input
run: |
VERSION=$(echo "${{ inputs.version }}" | sed -E "s/^v//g") # Ex: 1.2.3
echo "VERSION=$VERSION" >> $GITHUB_ENV
DATE=$(date +"%Y-%m-%d") # Ex: 2022-02-22
echo "DATE=$DATE" >> $GITHUB_ENV
- name: bump versions
run: |
MANPAGE=".TH wd \"1\" \"$DATE\" \"wd $VERSION\" \"wd Manual\""
sed -i -E "1 s/.*/$MANPAGE/" wd.1
sed -i -E "s/WD_VERSION=.*/WD_VERSION=$VERSION/" wd.sh
- name: commit changes
run: |
git add wd.1 wd.sh
git commit -m "chore(update): bump current version to v$VERSION"
git tag "v$VERSION"
git push -u origin ci-release-fixes --tags
- name: release latest
run: |
gh release create "v$VERSION" --generate-notes
env:
GH_TOKEN: ${{ github.token }}