forked from gregsaun/prusa_i3_bear_upgrade
-
Notifications
You must be signed in to change notification settings - Fork 0
133 lines (116 loc) · 4.09 KB
/
create_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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
################################################################################
#
# Manual github workflow to create a draft release with assets files (zip files)
#
# Author: Gregoire Saunier
# Website: http://github.com/gregsaun
#
# Description:
# This workflow is triggered manually and need a release version as input. It
# will then create a tag using this version, create a draft release, compress
# zip files containing STL, CAD, drawings, optional parts, etc. Those zip files
# are then uploaded to the draft release.
#
################################################################################
# This is a basic workflow that is manually triggered
name: Create Release
# Controls when the action will run. Workflow runs when manually triggered using the UI
# or API.
on:
workflow_dispatch:
# Inputs the workflow accepts.
inputs:
# Tag version
tag_version:
description: 'Tag version to create. e.g.: 2.1.0-rc1'
required: true
# Branch
branch_name:
description: 'Branch name used for the release. e.g.: dev'
default: 'master'
required: false
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
create_release:
runs-on: ubuntu-latest
steps:
#
# Checkout the repository
#
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ github.event.inputs.branch_name }} # branch to checkout
#
# Create tag for the release
#
- name: Create tag and push it
run: git tag ${{ github.event.inputs.tag_version }} && git push origin --tags
#
# Create assets (zip files)
#
- name: Create zip file
run: chmod +x ./scripts/create_release_assets.sh && ./scripts/create_release_assets.sh
#
# Create a draft release
#
- name: Create a release
id: create-release-id
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.event.inputs.tag_version }}
release_name: Bear Upgrade ${{ github.event.inputs.tag_version }}
body: |
## Improvements
## Bug fixes
## Compatibility
## How to upgrade
## Manual, BOM, Assembly guide
## Special thank you
draft: true
prerelease: true
#
# Upload assets to the release
#
- name: Upload Release Asset STL MK3
id: asset-bear21-mk3
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release-id.outputs.upload_url }}
asset_path: ./release_files/bear21_mk3-3s_stl.zip
asset_name: bear21_mk3-3s_stl.zip
asset_content_type: application/zip
- name: Upload Release Asset STL MK2
id: asset-bear21-mk2-25
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release-id.outputs.upload_url }}
asset_path: ./release_files/bear21_mk2-2s-25-25s_stl.zip
asset_name: bear21_mk2-2s-25-25s_stl.zip
asset_content_type: application/zip
- name: Upload Release Asset CAD And Drawings
id: asset-bear21-cad-drawings
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release-id.outputs.upload_url }}
asset_path: ./release_files/bear21_cad_drawings_files.zip
asset_name: bear21_cad_drawings_files.zip
asset_content_type: application/zip
- name: Upload Release Asset Optional Parts
id: asset-bear21-optional-parts
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release-id.outputs.upload_url }}
asset_path: ./release_files/bear21_optional_parts.zip
asset_name: bear21_optional_parts.zip
asset_content_type: application/zip