Skip to content

Commit cf1e11d

Browse files
Create GH Release
1 parent 856bd79 commit cf1e11d

1 file changed

Lines changed: 31 additions & 8 deletions

File tree

.github/workflows/deploy-to-gh-releases.yml

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,15 @@ jobs:
1616
name: GitHub Releases
1717
runs-on: ubuntu-latest
1818
steps:
19+
# Make directories for artifacts
20+
- name: Make artifact directories
21+
run: mkdir download artifacts
22+
1923
# Download the artifacts
20-
- name: Download artifact
24+
- name: Download artifacts
2125
uses: actions/download-artifact@v3
26+
with:
27+
path: download
2228

2329
# Tag commit with version number
2430
- name: Push version tag
@@ -29,11 +35,28 @@ jobs:
2935
custom_tag: ${{ inputs.version }}
3036
tag_prefix: ''
3137

32-
#
33-
# - name: Deploy the release to GitHub Releases
34-
# uses: fnkr/github-action-ghr@v1
35-
# if: startsWith(github.ref, 'refs/tags/2[0-9][0-9][0-9].[0-9]?[0-9].[0-9]+')
36-
# env:
37-
# GHR_PATH: dist/Yukon/
38-
# GITHUB_TOKEN: ${{ secrets.OPENCYPHAL_TOKEN }}
38+
# Gather artifacts in one directory
39+
- name: Gather artifacts
40+
run: |
41+
cd download
42+
for artifact in $(find * -type f -print)
43+
do
44+
arch=$(echo $artifact | cut -d/ -f1)
45+
base=$(echo $artifact | cut -d/ -f2 | cut -d. -f1)
46+
ext=$(echo $artifact | cut -d/ -f2 | awk -F. '{print $2}')
47+
if [[ $ext != '' ]]; then
48+
cp -p $artifact ../artifacts/$base-$arch.$ext
49+
else
50+
cp -p $artifact ../artifacts/$base-$arch
51+
fi
52+
done
53+
54+
# Create a release
55+
- name: Create a release
56+
uses: ncipollo/release-action@v1
57+
with:
58+
artifacts: artifacts/*
59+
artifactErrorsFailBuild: true
60+
tag: ${{ inputs.version }}
61+
token: ${{ secrets.OPENCYPHAL_TOKEN }}
3962

0 commit comments

Comments
 (0)