-
Notifications
You must be signed in to change notification settings - Fork 2
77 lines (68 loc) · 2.19 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Release public oee-simulators
name: Release oee-simulators
on:
workflow_dispatch:
inputs:
release_body:
type: string
description: GitHub Release Message
default: "New Release"
environment:
type: environment
description: Name of the environment to use
default: "test"
required: true
jobs:
call-build-workflow:
uses: ./.github/workflows/build.yml
with:
environment: ${{ inputs.environment }}
secrets:
C8Y_PASSWORD: ${{ secrets.C8Y_PASSWORD }}
build-release:
if: github.ref == 'refs/heads/main'
needs: call-build-workflow
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
path: 'repo'
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: 'oee-simulators'
path: 'repo/simulators'
- name: Zip files for release
shell: bash
run: |
cd repo/simulators
if [[ ! -f image.tar ]]; then
echo "Missing required files: image.tar"
exit 1
fi
if [[ ! -f cumulocity.json ]]; then
echo "Missing required files: cumulocity.json"
exit 1
fi
zip oee-simulators.zip image.tar cumulocity.json
- name: Create Release
uses: actions/create-release@v1
id: create_release
with:
draft: false
prerelease: false
release_name: v1.0.${{ needs.call-build-workflow.outputs.release_version }}
tag_name: v1.0.${{ needs.call-build-workflow.outputs.release_version }}
body: ${{ inputs.release_body }}
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Upload oee-sim zip
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # upload_url output is provided automatically by the GitHub API when the release is created
asset_path: 'repo/simulators/oee-simulators.zip'
asset_name: 'oee-simulators.zip'
asset_content_type: application/zip