-
Notifications
You must be signed in to change notification settings - Fork 59
84 lines (70 loc) · 3.01 KB
/
github-release-actions.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
###
### Simple script to build a zip file of the whole repository
###
## Major - Tasks:
# - ZIP
# - Build draft release
# - Attach Zip
# - Download Zip
name: Build Plugin Release - Action
on: [push]
jobs:
Build-Release-ZIP-Action:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v2
- run: echo "Read current plugin version..."
- run: export PLUGIN_VERSION=$(cat setup.py | grep 'plugin_version = "*"' | cut -d '"' -f2)
- run: echo "Plugin Version $PLUGIN_VERSION ${PLUGIN_VERSION}"
- run: echo "Build ZIP"
- run: zip -r master.zip * -i '\octoprint_*' 'translations' 'README.md' 'requirements.txt' 'setup.py'
- name: List files in the repository
run: |
ls ${{ github.workspace }}
- name: version
run: echo "::set-output name=version::$(cat setup.py | grep 'plugin_version = "*"' | cut -d '"' -f2)"
id: version
- name: Repository and Branch name
id: branch
run: |
export branch_name=${GITHUB_REF##*/}
echo "::set-output name=branch_name::$branch_name"
echo running on branch $branch_name
export repo_name=${GITHUB_REPOSITORY#*/}
echo "::set-output name=repo_name::$repo_name"
- name: release
uses: actions/create-release@latest
id: create_release
env:
GITHUB_TOKEN: ${{ github.token }}
with:
draft: true
commitish: ${{ steps.branch.outputs.branch_name }}
prerelease: false
release_name: V${{ steps.version.outputs.version }}-draft
tag_name: ${{ steps.version.outputs.version }}-draft
body: |
## [BugFix]
- #xxx
## [Enhancement]
- #xxx
## Counter
![downloaded](https://img.shields.io/github/downloads/OllisGit/${{ steps.branch.outputs.repo_name }}/${{ steps.version.outputs.version }}/total)
## Support my Efforts
This plugin, as well as my [other plugins](https://github.com/OllisGit/) were developed in my spare time.
If you like it, I would be thankful about a cup of coffee :)
[![More coffee, more code](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6SW5R6ZUKLB5E&source=url)
# body_path: RELEASE_TEMPLATE.md
- name: upload master.zip to release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: master.zip
asset_name: master.zip
asset_content_type: application/gzip
- name: download master.zip
run: curl -O -J -L -v https://github.com/OllisGit/${{ steps.branch.outputs.repo_name }}/releases/download/${{ steps.version.outputs.version }}/master.zip
- run: echo "🍏 This job's status is ${{ job.status }}."