@@ -2,115 +2,115 @@ name: Add Artifacts to Current Release
2
2
3
3
# Controls when the action will run.
4
4
on :
5
- # Allows you to run this workflow manually from the Actions tab
6
- workflow_dispatch :
5
+ # Allows you to run this workflow manually from the Actions tab
6
+ workflow_dispatch :
7
7
8
8
jobs :
9
- release :
10
- name : " Build and upload artifacts"
11
- runs-on : ${{ matrix.os }}
12
- strategy :
13
- matrix :
14
- os :
15
- - ubuntu-latest
16
- - macos-latest
17
- - windows-latest
18
-
9
+ release :
10
+ name : ' Build and upload artifacts'
11
+ runs-on : ${{ matrix.os }}
12
+ strategy :
13
+ matrix :
14
+ os :
15
+ - ubuntu-latest
16
+ - macos-latest
17
+ - windows-latest
18
+
19
+ env :
20
+ CHOOSENIM_CHOOSE_VERSION : stable
21
+ CHOOSENIM_NO_ANALYTICS : 1
22
+
23
+ steps :
24
+ # Cancel other actions of the same type that might be already running
25
+ - name : ' Cancel similar actions in progress'
26
+ uses : styfle/cancel-workflow-action@0.6.0
27
+ with :
28
+ access_token : ${{ github.token }}
29
+
30
+ # Detects OS and provide Nim-friendly OS identifiers
31
+ - name : Detect current OS
32
+ id : os
33
+ run : echo "::set-output name=id::${{matrix.os == 'ubuntu-latest' && 'linux' || matrix.os == 'macos-latest' && 'macosx' || matrix.os == 'windows-latest' && 'windows'}}"
34
+
35
+ # Checks out the repository
36
+ - uses : actions/checkout@v2
37
+
38
+ # Installs libraries
39
+ - name : install musl-gcc
40
+ run : sudo apt-get install -y musl-tools
41
+ if : matrix.os == 'ubuntu-latest'
42
+
43
+ # Sets path (Linux, macOS)
44
+ - name : Update $PATH
45
+ shell : bash
46
+ run : |
47
+ echo "$HOME/.nimble/bin" >> $GITHUB_PATH
48
+ echo $GITHUB_WORKSPACE >> $GITHUB_PATH
49
+
50
+ # Sets path (Windows)
51
+ - name : Update %PATH%
52
+ run : |
53
+ echo "${HOME}/.nimble/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
54
+ echo "${GITHUB_WORKSPACE}" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
55
+ if : matrix.os == 'windows-latest'
56
+
57
+ # Install the Nim compiler
58
+ - name : Install Nim
59
+ run : |
60
+ curl https://nim-lang.org/choosenim/init.sh -sSf > init.sh
61
+ sh init.sh -y
62
+
63
+ # Temporary Windows-specific fix (missing certificates for nimble)
64
+ - name : Install cert (temporary fix, windows only)
65
+ run : |
66
+ curl https://curl.se/ca/cacert.pem -L -o cacert.pem
67
+ if : matrix.os == 'windows-latest'
68
+
69
+ # Build for Linux
70
+ - name : Build (Linux)
71
+ run : |
72
+ nimble install -y nifty
73
+ nifty install
74
+ nimble build -v -y --passL:-static -d:release --gcc.exe:musl-gcc --gcc.linkerexe:musl-gcc --gc:orc --opt:size
75
+ if : matrix.os == 'ubuntu-latest'
76
+
77
+ # Build for macOS/Windows
78
+ - name : Build (macOS, Windows)
79
+ shell : bash
80
+ run : |
81
+ nimble install -y nifty
82
+ nifty install
83
+ nimble build -v -y -d:release --gc:orc --opt:size
84
+ if : matrix.os == 'macos-latest' || matrix.os == 'windows-latest'
85
+
86
+ # Retrieve ID and Name of the current (draft) release
87
+ - name : ' Get current release'
88
+ id : current-release
89
+ uses : InsonusK/get-latest-release@v1.0.1
90
+ with :
91
+ myToken : ${{ github.token }}
92
+ exclude_types : ' release'
93
+ view_top : 1
94
+
95
+ # Package the resulting Linux/macOS binary
96
+ - name : Create artifact (Linux, macOS)
97
+ shell : bash
98
+ run : zip hastyscribe_${{steps.current-release.outputs.tag_name}}_${{steps.os.outputs.id}}_x64.zip hastyscribe
99
+ if : matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
100
+
101
+ # Package the resulting Windows binary
102
+ - name : Create artifact (Windows)
103
+ run : Compress-Archive -Path hastyscribe.exe -DestinationPath hastyscribe_${{steps.current-release.outputs.tag_name}}_windows_x64.zip
104
+ if : matrix.os == 'windows-latest'
105
+
106
+ # Upload artifacts to current draft release
107
+ - name : ' Upload to current release'
108
+ uses : xresloader/upload-to-github-release@v1
19
109
env :
20
- CHOOSENIM_CHOOSE_VERSION : stable
21
- CHOOSENIM_NO_ANALYTICS : 1
22
-
23
- steps :
24
- # Cancel other actions of the same type that might be already running
25
- - name : " Cancel similar actions in progress"
26
- uses : styfle/cancel-workflow-action@0.6.0
27
- with :
28
- access_token : ${{ github.token }}
29
-
30
- # Detects OS and provide Nim-friendly OS identifiers
31
- - name : Detect current OS
32
- id : os
33
- run : echo "::set-output name=id::${{matrix.os == 'ubuntu-latest' && 'linux' || matrix.os == 'macos-latest' && 'macosx' || matrix.os == 'windows-latest' && 'windows'}}"
34
-
35
- # Checks out the repository
36
- - uses : actions/checkout@v2
37
-
38
- # Installs libraries
39
- - name : install musl-gcc
40
- run : sudo apt-get install -y musl-tools
41
- if : matrix.os == 'ubuntu-latest'
42
-
43
- # Sets path (Linux, macOS)
44
- - name : Update $PATH
45
- shell : bash
46
- run : |
47
- echo "$HOME/.nimble/bin" >> $GITHUB_PATH
48
- echo $GITHUB_WORKSPACE >> $GITHUB_PATH
49
-
50
- # Sets path (Windows)
51
- - name : Update %PATH%
52
- run : |
53
- echo "${HOME}/.nimble/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
54
- echo "${GITHUB_WORKSPACE}" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
55
- if : matrix.os == 'windows-latest'
56
-
57
- # Install the Nim compiler
58
- - name : Install Nim
59
- run : |
60
- curl https://nim-lang.org/choosenim/init.sh -sSf > init.sh
61
- sh init.sh -y
62
-
63
- # Temporary Windows-specific fix (missing certificates for nimble)
64
- - name : Install cert (temporary fix, windows only)
65
- run : |
66
- curl https://curl.se/ca/cacert.pem -L -o cacert.pem
67
- if : matrix.os == 'windows-latest'
68
-
69
- # Build for Linux
70
- - name : Build (Linux)
71
- run : |
72
- nimble install -y nifty
73
- nifty install
74
- nimble build -v -y -d:release --gcc.exe:musl-gcc --gcc.linkerexe:musl-gcc --gc:orc --opt:size
75
- if : matrix.os == 'ubuntu-latest'
76
-
77
- # Build for macOS/Windows
78
- - name : Build (macOS, Windows)
79
- shell : bash
80
- run : |
81
- nimble install -y nifty
82
- nifty install
83
- nimble build -v -y -d:release --gc:orc --opt:size
84
- if : matrix.os == 'macos-latest' || matrix.os == 'windows-latest'
85
-
86
- # Retrieve ID and Name of the current (draft) release
87
- - name : " Get current release"
88
- id : current-release
89
- uses : InsonusK/get-latest-release@v1.0.1
90
- with :
91
- myToken : ${{ github.token }}
92
- exclude_types : " release"
93
- view_top : 1
94
-
95
- # Package the resulting Linux/macOS binary
96
- - name : Create artifact (Linux, macOS)
97
- shell : bash
98
- run : zip hastyscribe_${{steps.current-release.outputs.tag_name}}_${{steps.os.outputs.id}}_x64.zip hastyscribe
99
- if : matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
100
-
101
- # Package the resulting Windows binary
102
- - name : Create artifact (Windows)
103
- run : Compress-Archive -Path hastyscribe.exe -DestinationPath hastyscribe_${{steps.current-release.outputs.tag_name}}_windows_x64.zip
104
- if : matrix.os == 'windows-latest'
105
-
106
- # Upload artifacts to current draft release
107
- - name : " Upload to current release"
108
- uses : xresloader/upload-to-github-release@v1
109
- env :
110
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
111
- with :
112
- file : " hastyscribe_v*.zip"
113
- overwrite : true
114
- tag_name : ${{steps.current-release.outputs.tag_name}}
115
- release_id : ${{steps.current-release.outputs.id }}
116
- verbose : true
110
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
111
+ with :
112
+ file : ' hastyscribe_v*.zip'
113
+ overwrite : true
114
+ tag_name : ${{steps.current-release.outputs.tag_name}}
115
+ release_id : ${{steps.current-release.outputs.id }}
116
+ verbose : true
0 commit comments