-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (48 loc) · 1.75 KB
/
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
name: Docker Image CI
on:
push:
tags:
- "v*"
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Infer the version from the github ref
id: inferVersion
run: |
prefix="refs/tags/v"
if [[ ! "${GITHUB_REF}" == ${prefix}* ]]; then
echo "Unexpected GITHUB_REF: ${GITHUB_REF}"
exit 1
fi
version="${GITHUB_REF:${#prefix}}"
echo "The version is: ${version}"
if [[ "${version}" == *"'"* ]]; then
echo "Unexpected version containing a single quote: ${version}"
exit 1
fi
if [[ "${version}" == *'"'* ]]; then
echo "Unexpected version containing a double quote: ${version}"
exit 1
fi
if [[ "${version}" == *':'* ]]; then
echo "Unexpected version containing a full colon: ${version}"
exit 1
fi
echo "::set-output name=version::${version}"
- uses: actions/checkout@v4
- name: Build the Docker image
run: |
cd capability-check-node-red
docker build -t capability-check-node-red:v${{ steps.inferVersion.outputs.version }} -f Dockerfile ..
- name: Export the Docker image
run: docker save -o capability-check-node-red_v${{ steps.inferVersion.outputs.version }}.tar capability-check-node-red:v${{ steps.inferVersion.outputs.version }}
- name: Upload the release assets
uses: Hs1r1us/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: "v${{ steps.inferVersion.outputs.version }}"
asset_files: "capability-check-node-red/node-red-capability-check_v${{ steps.inferVersion.outputs.version }}.tar"