Skip to content

Commit 4690b05

Browse files
committed
Adding --passL:-static for linux builds (ref: #82)
1 parent 20dac6c commit 4690b05

File tree

2 files changed

+148
-148
lines changed

2 files changed

+148
-148
lines changed

.github/workflows/add-artifacts-to-current-release.yml

+109-109
Original file line numberDiff line numberDiff line change
@@ -2,115 +2,115 @@ name: Add Artifacts to Current Release
22

33
# Controls when the action will run.
44
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:
77

88
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
19109
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

.github/workflows/ci.yml

+39-39
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,46 @@ name: CI
22

33
# Controls when the action will run.
44
on:
5-
# Triggers the workflow on push or pull request events but only for the master branch
6-
push:
7-
branches: [master]
8-
tags-ignore: ["**"]
9-
pull_request:
10-
branches: [master]
11-
tags-ignore: ["**"]
5+
# Triggers the workflow on push or pull request events but only for the master branch
6+
push:
7+
branches: [master]
8+
tags-ignore: ['**']
9+
pull_request:
10+
branches: [master]
11+
tags-ignore: ['**']
1212

13-
# Allows you to run this workflow manually from the Actions tab
14-
workflow_dispatch:
13+
# Allows you to run this workflow manually from the Actions tab
14+
workflow_dispatch:
1515

1616
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1717
jobs:
18-
# This workflow contains a single job called "ci"
19-
ci:
20-
# The type of runner that the job will run on
21-
runs-on: ubuntu-latest
22-
env:
23-
CHOOSENIM_CHOOSE_VERSION: stable
24-
CHOOSENIM_NO_ANALYTICS: 1
25-
26-
# Steps represent a sequence of tasks that will be executed as part of the job
27-
steps:
28-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
29-
- uses: actions/checkout@v2
30-
31-
- name: install musl-gcc
32-
run: sudo apt-get install -y musl-tools
33-
34-
- name: Update $PATH
35-
run: echo "$HOME/.nimble/bin" >> $GITHUB_PATH
36-
37-
- name: Install Nim
38-
run: |
39-
curl https://nim-lang.org/choosenim/init.sh -sSf > init.sh
40-
sh init.sh -y
41-
42-
- name: Build
43-
run: |
44-
nimble install -y nifty
45-
nifty install
46-
nimble build -y -d:release --gcc.exe:musl-gcc --gcc.linkerexe:musl-gcc
47-
./hastyscribe doc/HastyScribe_UserGuide.md
18+
# This workflow contains a single job called "ci"
19+
ci:
20+
# The type of runner that the job will run on
21+
runs-on: ubuntu-latest
22+
env:
23+
CHOOSENIM_CHOOSE_VERSION: stable
24+
CHOOSENIM_NO_ANALYTICS: 1
25+
26+
# Steps represent a sequence of tasks that will be executed as part of the job
27+
steps:
28+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
29+
- uses: actions/checkout@v2
30+
31+
- name: install musl-gcc
32+
run: sudo apt-get install -y musl-tools
33+
34+
- name: Update $PATH
35+
run: echo "$HOME/.nimble/bin" >> $GITHUB_PATH
36+
37+
- name: Install Nim
38+
run: |
39+
curl https://nim-lang.org/choosenim/init.sh -sSf > init.sh
40+
sh init.sh -y
41+
42+
- name: Build
43+
run: |
44+
nimble install -y nifty
45+
nifty install
46+
nimble build -y -d:release --passL:-static --gcc.exe:musl-gcc --gcc.linkerexe:musl-gcc
47+
./hastyscribe doc/HastyScribe_UserGuide.md

0 commit comments

Comments
 (0)