Skip to content

Commit eef9eeb

Browse files
author
flo
committed
automated release creation
1 parent a84f1d3 commit eef9eeb

File tree

2 files changed

+68
-2
lines changed

2 files changed

+68
-2
lines changed

.github/workflows/release.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v[0-9]+.[0-9]+.[0-9]+'
7+
workflow_dispatch:
8+
inputs:
9+
major_version:
10+
type: number
11+
required: true
12+
minor_version:
13+
type: number
14+
required: true
15+
patch_version:
16+
type: number
17+
required: true
18+
19+
env:
20+
ARTIFACT_DIR: FritzBoxShell-${{ github.ref_name }}
21+
RELEASE_NAME: ${{ github.event_name == 'push' && github.ref_name || format('v{0}.{1}.{2}', inputs.major_version, inputs.minor_version, inputs.patch_version) }}
22+
23+
jobs:
24+
create-artifacts:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: setup rsync
28+
uses: GuillaumeFalourd/setup-rsync@v1.2
29+
- name: git checkout
30+
uses: actions/checkout@v2
31+
- name: inject version automatically
32+
run: sed -i "s|version=.*\.dev|version=$(echo "${{ env.RELEASE_NAME }}" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')|" fritzBoxShell.sh
33+
- name: create artifact directory
34+
run: |
35+
mkdir ${{ env.ARTIFACT_DIR }}
36+
rsync -arv --progress --exclude=".git*" --exclude="${{ env.ARTIFACT_DIR }}" . ${{ env.ARTIFACT_DIR }}
37+
- name: create .zip artifact
38+
uses: thedoctor0/zip-release@0.7.5
39+
with:
40+
type: 'zip'
41+
filename: ${{ env.RELEASE_NAME }}.zip
42+
path: ./${{ env.ARTIFACT_DIR }}
43+
- name: create .tar.gz artifact
44+
uses: thedoctor0/zip-release@0.7.5
45+
with:
46+
type: 'tar'
47+
filename: ${{ env.RELEASE_NAME }}.tar.gz
48+
path: ./${{ env.ARTIFACT_DIR }}
49+
- name: collect artifacts
50+
run: |
51+
mkdir artifacts
52+
mv ${{ env.RELEASE_NAME }}.tar.gz ${{ env.RELEASE_NAME }}.zip artifacts
53+
- name: upload artifacts
54+
# @todo replace by an action like https://github.com/marketplace/actions/gh-release
55+
uses: actions/upload-artifact@v3
56+
with:
57+
name: ${{ env.RELEASE_NAME }}
58+
path: 'artifacts/*'
59+
- name: release
60+
uses: softprops/action-gh-release@v2
61+
if: startsWith(github.ref, 'refs/tags/v')
62+
with:
63+
files: |
64+
artifacts/${{ env.RELEASE_NAME }}.zip
65+
artifacts/${{ env.RELEASE_NAME }}.tar.gz
66+

fritzBoxShell.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# AVM, FRITZ!, Fritz!Box and the FRITZ! logo are registered trademarks of AVM GmbH - https://avm.de/
2222

2323

24-
version=1.0.9
24+
version=1.0.dev
2525

2626
dir=$(dirname "$0")
2727

@@ -1097,4 +1097,4 @@ else
10971097
Reboot "$option2"
10981098
else DisplayArguments
10991099
fi
1100-
fi
1100+
fi

0 commit comments

Comments
 (0)