Skip to content

Commit 8bbb40e

Browse files
committed
.github/workflow: Add auto release publish workflow
Signed-off-by: Shi Jin <sjina@amazon.com>
1 parent 951e40d commit 8bbb40e

File tree

1 file changed

+88
-0
lines changed

1 file changed

+88
-0
lines changed

.github/workflows/auto-release.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Auto Release
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
7+
permissions:
8+
contents: write
9+
packages: read
10+
11+
jobs:
12+
release:
13+
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release')
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
ref: ${{ github.event.pull_request.base.ref }}
20+
fetch-depth: 0
21+
22+
- name: Extract version
23+
id: version
24+
run: |
25+
VERSION=$(grep 'AC_INIT' configure.ac | sed 's/.*\[libfabric\], \[\([^]]*\)\].*/\1/')
26+
TAG="v$VERSION"
27+
echo "Extracted version: $VERSION"
28+
echo "Release tag: $TAG"
29+
echo "version=$VERSION" >> $GITHUB_OUTPUT
30+
echo "tag=$TAG" >> $GITHUB_OUTPUT
31+
32+
- name: Build libfabric
33+
run: |
34+
set -x
35+
./autogen.sh
36+
./configure --prefix=$PWD/install
37+
make
38+
make install
39+
make dist
40+
41+
- name: Build fabtests
42+
run: |
43+
set -x
44+
cd fabtests
45+
./autogen.sh
46+
./configure --with-libfabric=$PWD/../install
47+
make dist
48+
49+
- name: Generate checksums
50+
id: checksums
51+
run: |
52+
echo "sha512_sums<<EOF" >> $GITHUB_OUTPUT
53+
sha512sum libfabric-*.tar.* fabtests/fabtests-*.tar.* >> $GITHUB_OUTPUT
54+
echo "EOF" >> $GITHUB_OUTPUT
55+
echo "md5_sums<<EOF" >> $GITHUB_OUTPUT
56+
md5sum libfabric-*.tar.* fabtests/fabtests-*.tar.* >> $GITHUB_OUTPUT
57+
echo "EOF" >> $GITHUB_OUTPUT
58+
59+
- name: Create Release
60+
uses: softprops/action-gh-release@v1
61+
env:
62+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63+
with:
64+
tag_name: ${{ steps.version.outputs.tag }}
65+
name: Libfabric ${{ steps.version.outputs.version }}
66+
target_commitish: ${{ github.event.pull_request.base.ref }}
67+
draft: true
68+
body: |
69+
The OpenFabrics Interfaces Working Group (OFIWG) and the libfabric open-source community are pleased to announce the release of version ${{ steps.version.outputs.version }} of libfabric. See [NEWS.md](https://github.com/${{ github.repository }}/blob/${{ steps.version.outputs.tag }}/NEWS.md) for the list of features and enhancements that have been added since the last release. Installation instructions are available in the [README.md](https://github.com/${{ github.repository }}/blob/${{ steps.version.outputs.tag }}/README.md) file in the source tree or at the project's homepage.
70+
71+
Download the distribution tarballs below to get started:
72+
73+
**sha512 sums**
74+
```
75+
${{ steps.checksums.outputs.sha512_sums }}
76+
```
77+
78+
**md5sums**
79+
```
80+
${{ steps.checksums.outputs.md5_sums }}
81+
```
82+
83+
${{ github.event.pull_request.body }}
84+
files: |
85+
libfabric-*.tar.gz
86+
libfabric-*.tar.bz2
87+
fabtests/fabtests-*.tar.gz
88+
fabtests/fabtests-*.tar.bz2

0 commit comments

Comments
 (0)