-
Notifications
You must be signed in to change notification settings - Fork 363
79 lines (72 loc) · 3.6 KB
/
draft-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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#
# Make a draft release when tagging
#
# The release assets are automatically downloaded from the GMT FTP server and uploaded
# to GitHub.
#
on:
push:
# Sequence of patterns matched against refs/tags/x.x.x and refs/tags/x.x.xrcx
tags:
# Push events to matching versions, e.g., 6.1.0, 6.1.0rc1
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+rc[0-9]+'
name: Create a Draft Release
jobs:
draft-release:
name: Create a Draft Release
runs-on: macos-latest # Have to use macos because linux sometimes timeouts
steps:
- name: Set GMT version from tag name
# ${GITHUB_REF} is "refs/tags/6.0.0" for tags
# after this step, the GMT version can be used as ${{ env.GMT_VERSION }}
run: echo "GMT_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
# Uncomment the following line for debugging only
# run: echo "GMT_VERSION=${DEBUG_GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Download GMT tarballs and installers
run: |
curl -O ftp://ftp.soest.hawaii.edu/gmt/bin/gmt-${{ env.GMT_VERSION }}-darwin-x86_64.dmg
curl -O ftp://ftp.soest.hawaii.edu/gmt/bin/gmt-${{ env.GMT_VERSION }}-darwin-arm64.dmg
curl -O ftp://ftp.soest.hawaii.edu/gmt/gmt-${{ env.GMT_VERSION }}-src.tar.gz
curl -O ftp://ftp.soest.hawaii.edu/gmt/gmt-${{ env.GMT_VERSION }}-src.tar.xz
curl -O ftp://ftp.soest.hawaii.edu/gmt/bin/gmt-${{ env.GMT_VERSION }}-win64.exe
curl -O ftp://ftp.soest.hawaii.edu/gmt/bin/gmt-${{ env.GMT_VERSION }}-win64.zip
- name: Checksum
run: |
shasum -a 256 \
gmt-${{ env.GMT_VERSION }}-darwin-x86_64.dmg \
gmt-${{ env.GMT_VERSION }}-darwin-arm64.dmg \
gmt-${{ env.GMT_VERSION }}-src.tar.gz \
gmt-${{ env.GMT_VERSION }}-src.tar.xz \
gmt-${{ env.GMT_VERSION }}-win64.exe \
gmt-${{ env.GMT_VERSION }}-win64.zip \
> gmt-${{ env.GMT_VERSION }}-checksums.txt
# Display the checksums
cat gmt-${{ env.GMT_VERSION }}-checksums.txt
- name: Create a Draft Release
id: create_release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: ${{ env.GMT_VERSION }}
body: |
| **File** | **Description** |
|--------------------------------|-----------------------------------------|
| gmt-${{ env.GMT_VERSION }}-checksums.txt | sha256sum of source and binary packages |
| gmt-${{ env.GMT_VERSION }}-darwin-x86_64.dmg | macOS bundle (intel) |
| gmt-${{ env.GMT_VERSION }}-darwin-arm64.dmg | macOS bundle (arm64) |
| gmt-${{ env.GMT_VERSION }}-src.tar.gz | Source code |
| gmt-${{ env.GMT_VERSION }}-src.tar.xz | Source code |
| gmt-${{ env.GMT_VERSION }}-win64.exe | Windows installer (64bit) |
| gmt-${{ env.GMT_VERSION }}-win64.zip | Windows portable installer (64bit) |
draft: true
prerelease: false
files: |
gmt-${{ env.GMT_VERSION }}-checksums.txt
gmt-${{ env.GMT_VERSION }}-darwin-x86_64.dmg
gmt-${{ env.GMT_VERSION }}-darwin-arm64.dmg
gmt-${{ env.GMT_VERSION }}-src.tar.gz
gmt-${{ env.GMT_VERSION }}-src.tar.xz
gmt-${{ env.GMT_VERSION }}-win64.exe
gmt-${{ env.GMT_VERSION }}-win64.zip