Skip to content

Commit 63223d8

Browse files
authored
Merge pull request #4 from Neotron-Compute/feature/make-release-tarballs
Script for making a github release.
2 parents 892e17a + 62affa6 commit 63223d8

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
on:
2+
push:
3+
tags:
4+
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
5+
6+
name: Upload Release
7+
8+
jobs:
9+
build:
10+
name: Upload Release
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
- name: Set version number # Replace [Uncontrolled] with actual tag
16+
env:
17+
GITHUB_REF: ${{ github.ref }}
18+
run: |
19+
sed -i "s~\[Uncontrolled\]~${GITHUB_REF/#refs\/tags\/}~g" Kicad/*.sch Kicad/*.kicad_pcb
20+
- name: Build project # This would actually build your project, using zip for an example artifact
21+
uses: nerdyscout/[email protected]
22+
with:
23+
config: 'Kicad/docs.yml'
24+
dir: docs
25+
schema: 'Kicad/Neotron-Common-Hardware.sch'
26+
board: 'Kicad/Neotron-Common-Hardware.kicad_pcb'
27+
- name: Create Release
28+
id: create_release
29+
uses: actions/create-release@v1
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
with:
33+
tag_name: ${{ github.ref }}
34+
release_name: Release ${{ github.ref }}
35+
draft: false
36+
prerelease: false
37+
- name: Build zip file
38+
run: |
39+
zip -r --junk-paths neotron-common-hardware-release.zip docs/
40+
- name: Upload Release
41+
id: upload-release-asset
42+
uses: actions/upload-release-asset@v1
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
with:
46+
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing its ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
47+
asset_path: ./neotron-common-hardware-release.zip
48+
asset_name: neotron-common-hardware-release.zip
49+
asset_content_type: application/zip

0 commit comments

Comments
 (0)