File tree Expand file tree Collapse file tree 5 files changed +113
-0
lines changed Expand file tree Collapse file tree 5 files changed +113
-0
lines changed Original file line number Diff line number Diff line change
1
+ on : push
2
+
3
+ jobs :
4
+ install-latest :
5
+ runs-on : ubuntu-latest
6
+ steps :
7
+ - name : Checkout
8
+ uses : actions/checkout@v3
9
+ - name : Install Knope
10
+ uses : knope-dev/action@v1
11
+ - name : Test Knope
12
+ run : knope --help
13
+ - name : Verify no artifacts in path
14
+ run : git status
15
+ install-specific-version :
16
+ runs-on : ubuntu-latest
17
+ steps :
18
+ - name : Checkout
19
+ uses : actions/checkout@v3
20
+ - name : Install Knope
21
+ uses : knope-dev/action@v1
22
+ with :
23
+ version : 0.4.3
24
+ - name : Test Knope
25
+ run : knope --help
26
+ - name : Verify no artifacts in path
27
+ run : git status
Original file line number Diff line number Diff line change
1
+ .idea /
Original file line number Diff line number Diff line change
1
+ # Knope GitHub Action
2
+
3
+ A GitHub action to install [ Knope] .
4
+
5
+ ## Examples
6
+
7
+ ### Install Specific Version (recommended)
8
+ ``` yaml
9
+ on : push
10
+
11
+ jobs :
12
+ test :
13
+ runs-on : ubuntu-latest
14
+ steps :
15
+ - name : Install Knope
16
+ uses : knope-dev/action@v1
17
+ with :
18
+ version : 0.4.3
19
+ - name : Use Knope
20
+ run : knope --help
21
+ ` ` `
22
+
23
+ ### Install Latest Version
24
+
25
+ **You will eventually experience breaking changes if you do this.**
26
+
27
+ ` ` ` yaml
28
+ on : push
29
+
30
+ jobs :
31
+ test :
32
+ runs-on : ubuntu-latest
33
+ steps :
34
+ - name : Install Knope
35
+ uses : knope-dev/action@v1
36
+ - name : Use Knope
37
+ run : knope --help
38
+ ` ` `
39
+
40
+ [Knope]: https://knope-dev.github.io/knope/
Original file line number Diff line number Diff line change
1
+ name : " Install Knope"
2
+ description : " Installs a specified version of Knope, or the latest if unspecified."
3
+ branding :
4
+ icon : download
5
+ color : blue
6
+ inputs :
7
+ version :
8
+ description : " Specific version to download, defaults to latest."
9
+ required : false
10
+ default : " LATEST"
11
+ runs :
12
+ using : " composite"
13
+ steps :
14
+ - name : " Set version"
15
+ id : " set_version"
16
+ shell : bash
17
+ run : echo "::set-output name=version::$(python ${{ github.action_path }}/get_knope_version.py ${{ inputs.version }})"
18
+ - name : " Download Knope"
19
+ id : " download_knope"
20
+ shell : bash
21
+ run : |
22
+ cd ${{ github.action_path }}
23
+ wget https://github.com/knope-dev/knope/releases/download/${{ steps.set_version.outputs.version }}/knope-x86_64-unknown-linux-musl-${{ steps.set_version.outputs.version }}.tgz
24
+ tar -xvf knope-x86_64-unknown-linux-musl-${{ steps.set_version.outputs.version }}.tgz
25
+ cp knope-x86_64-unknown-linux-musl-${{ steps.set_version.outputs.version }}/knope ${{ github.action_path }}
26
+ echo "${{ github.action_path }}" >> $GITHUB_PATH
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env python3
2
+
3
+ import json
4
+ import ssl
5
+ import sys
6
+ from urllib import request
7
+
8
+ input_version = sys .argv [1 ]
9
+
10
+ if input_version != "LATEST" :
11
+ if not input_version .startswith ("v" ):
12
+ input_version = "v" + input_version
13
+ print (input_version )
14
+ sys .exit (0 )
15
+
16
+ context = ssl .create_default_context ()
17
+ response = request .urlopen ("https://api.github.com/repos/knope-dev/knope/releases?per_page=1" , context = context )
18
+ data = json .loads (response .read ())
19
+ print (data [0 ]["tag_name" ])
You can’t perform that action at this time.
0 commit comments