-
Notifications
You must be signed in to change notification settings - Fork 339
96 lines (87 loc) · 3.08 KB
/
upload_artifact.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: upload_artifact(decide by version)
on:
workflow_dispatch:
push:
branches: [main]
paths:
- "version.json"
jobs:
upload_artifact:
name: Bupload_artifact
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
name: Check out code
- name: Read Plugin Version
id: update_data
run: |
version=$(jq -r '.version' version.json)
real_version=${version%%-*}
echo "VERSION=$real_version" >> $GITHUB_ENV
echo "RC_VERSION=$version" >> $GITHUB_ENV
changelog=$(cat changelog_latest.md)
echo "CHANGELOG<<EOF" >> $GITHUB_OUTPUT
echo "$changelog" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
if [[ $version == *-* ]]; then
echo "release version"
echo "::set-output name=release::false"
else
echo "rc release version"
echo "::set-output name=release::true"
fi
mkdir websoft9 artifacts
cp -r docker websoft9
cp -r cockpit websoft9
cp -r scripts websoft9
cp -r install websoft9
cp -r docs websoft9
cp -r systemd websoft9
cp *.md websoft9
cp version.json websoft9
zip -r websoft9-$real_version.zip websoft9
cp websoft9-$real_version.zip artifacts
cp install/install.sh artifacts
cp version.json artifacts
cp CHANGELOG.md artifacts
cp artifacts/websoft9-$real_version.zip artifacts/websoft9-latest.zip
- name: Upload To Azure Blob
uses: LanceMcCarthy/Action-AzureBlobUpload@v2
if: ${{ steps.update_data.outputs.release == 'false' }}
with:
connection_string: ${{ secrets.AZURE_STORAGE_ARTIFACT }}
container_name: dev
source_folder: artifacts/
destination_folder: ./websoft9
delete_if_exists: true
fail_if_source_empty: true
- name: Create Release
uses: softprops/action-gh-release@v1
if: ${{ steps.update_data.outputs.release == 'false' }}
with:
files: /*
tag_name: v${{ env.RC_VERSION }}
title: Release-v${{ env.RC_VERSION }}
body: ${{ steps.update_data.outputs.CHANGELOG }}
draft: false
prerelease: false
- name: Upload To Azure Blob
uses: LanceMcCarthy/Action-AzureBlobUpload@v2
if: ${{ steps.update_data.outputs.release == 'true' }}
with:
connection_string: ${{ secrets.AZURE_STORAGE_ARTIFACT }}
container_name: release
source_folder: artifacts/
destination_folder: ./websoft9
delete_if_exists: true
fail_if_source_empty: true
- name: Create Release
uses: softprops/action-gh-release@v1
if: ${{ steps.update_data.outputs.release == 'true' }}
with:
files: /*
tag_name: v${{ env.VERSION }}
title: Release-v${{ env.VERSION }}
body: ${{ steps.update_data.outputs.CHANGELOG }}
draft: false
prerelease: false