@@ -27,18 +27,15 @@ jobs:
27
27
- os : ubuntu-latest
28
28
os-arch : linux-x86_64
29
29
release-flags : --flag '--static -g -fbacktrace -O3'
30
- sha256sum : sha256sum
31
30
32
31
- os : macos-latest
33
32
os-arch : macos-x86_64
34
33
release-flags : --flag '-g -fbacktrace -O3'
35
- sha256sum : shasum -a 256
36
34
37
35
- os : windows-latest
38
36
os-arch : windows-x86_64
39
37
release-flags : --flag '--static -g -fbacktrace -O3'
40
38
exe : .exe
41
- sha256sum : sha256sum
42
39
43
40
env :
44
41
FC : gfortran
72
69
shell : bash
73
70
run : |
74
71
mv $(which fpm) fpm-bootstrap${{ matrix.exe }}
75
- echo "BOOTSTRAP=$PWD/fpm-bootstrap" | cat >> $GITHUB_ENV
72
+ echo "BOOTSTRAP=$PWD/fpm-bootstrap" >> $GITHUB_ENV
76
73
77
74
- name : Build Fortran fpm (bootstrap)
78
75
shell : bash
@@ -102,21 +99,21 @@ jobs:
102
99
run : |
103
100
${{ env.BOOTSTRAP }} run --runner cp -- fpm-debug${{ matrix.exe }}
104
101
rm -v ${{ env.BOOTSTRAP }}
105
- echo "FPM=$PWD/fpm-debug" | cat >> $GITHUB_ENV
102
+ echo "FPM=$PWD/fpm-debug" >> $GITHUB_ENV
106
103
107
104
- name : Get version (normal)
108
105
if : github.event_name != 'release'
109
106
shell : bash
110
107
run : |
111
108
VERSION=$(git rev-parse --short HEAD)
112
- echo "VERSION=$VERSION" | cat >> $GITHUB_ENV
109
+ echo "VERSION=$VERSION" >> $GITHUB_ENV
113
110
114
111
- name : Get version (release)
115
112
if : github.event_name == 'release'
116
113
shell : bash
117
114
run : |
118
115
VERSION=$(echo ${{ github.ref }} | cut -dv -f2)
119
- echo "VERSION=$VERSION" | cat >> $GITHUB_ENV
116
+ echo "VERSION=$VERSION" >> $GITHUB_ENV
120
117
FPM_VERSION=$(${{ env.FPM }} --version | grep -o '${{ env.REGEX }}')
121
118
[ "$VERSION" = "$FPM_VERSION" ]
122
119
env :
@@ -154,27 +151,47 @@ jobs:
154
151
run : |
155
152
${{ env.FPM }} run ${{ matrix.release-flags }} --runner cp -- ${{ env.EXE }}
156
153
rm -v ${{ env.FPM }}
157
- echo "FPM_RELEASE=$PWD/$ {{ env.EXE }}" | cat >> $GITHUB_ENV
154
+ echo "FPM_RELEASE=${{ env.EXE }}" >> $GITHUB_ENV
158
155
env :
159
156
EXE : fpm-${{ env.VERSION }}-${{ matrix.os-arch }}${{ matrix.exe }}
160
157
161
158
- name : Run release version
162
159
shell : bash
163
160
run : |
164
- ci/run_tests.sh "${{ env.FPM_RELEASE }}"
161
+ ci/run_tests.sh "$PWD/$ {{ env.FPM_RELEASE }}"
165
162
166
- - name : Stage release files for upload
167
- if : github.event_name == 'release'
168
- shell : bash
163
+ - name : Upload artifact
164
+ uses : actions/upload-artifact@v2
165
+ with :
166
+ name : ${{ env.FPM_RELEASE }}
167
+ path : ${{ env.FPM_RELEASE }}
168
+
169
+ upload-artifacts :
170
+ if : github.event_name == 'release'
171
+ runs-on : ubuntu-latest
172
+ needs :
173
+ - build
174
+
175
+ steps :
176
+ - name : Download Artifacts
177
+ uses : actions/download-artifact@v2
178
+ with :
179
+ path : ${{ github.workspace }} # This will download all files
180
+
181
+ - name : Create SHA256 checksums
169
182
run : |
170
- ${{ matrix.sha256sum }} ${{ env.FPM_RELEASE }} > ${{ env.FPM_RELEASE }}.sha256
183
+ for output in fpm-*/fpm-*; do
184
+ pushd $(dirname "$output")
185
+ sha256sum $(basename "$output") | tee $(basename "$output").sha256
186
+ popd
187
+ done
171
188
172
189
- name : Upload assets
173
190
if : github.event_name == 'release'
174
191
uses : svenstaro/upload-release-action@v2
175
192
with :
176
193
repo_token : ${{ secrets.GITHUB_TOKEN }}
177
- file : fpm-*
194
+ file : fpm-*/fpm-*
178
195
file_glob : true
179
196
tag : ${{ github.ref }}
180
197
overwrite : true
0 commit comments