-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (42 loc) · 1.13 KB
/
release.yml
File metadata and controls
46 lines (42 loc) · 1.13 KB
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
39
40
41
42
43
44
45
46
name: Release Data
on:
push:
tags:
- 'v*-data'
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
lfs: true
fetch-depth: 0
- name: Get tag message
id: tag_info
shell: bash
run: |
# Get the tag contents for the current ref
TAG_MESSAGE=$(git tag -l --format='%(contents)' ${{ github.ref_name }})
# If no message is found, use the tag name
if [ -z "$TAG_MESSAGE" ]; then
TAG_MESSAGE="Data release for ${{ github.ref_name }}"
fi
# Output for next step
{
echo "message<<EOF"
echo "$TAG_MESSAGE"
echo "EOF"
} >> "$GITHUB_OUTPUT"
- name: Create Release and Upload Assets
uses: softprops/action-gh-release@v2
with:
name: "${{ github.ref_name }}"
body: ${{ steps.tag_info.outputs.message }}
files: |
*.nc
*.grib
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}