Skip to content

Commit 97fa110

Browse files
committed
Add upload artifact step. (#85)
* Add upload artifact step. * pull cmake publish, move to one cmake Co-authored-by: Farzon Lotfi <[email protected]>
1 parent 984d91e commit 97fa110

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

.github/workflows/cmake.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,22 @@ jobs:
1818
strategy:
1919
matrix:
2020
os: [ubuntu-latest, macos-latest, windows-2019]
21+
include:
22+
- os: ubuntu-latest
23+
artifact_dlib_ext: .so
24+
artifact_staticlib_ext: .a
25+
- os: windows-2019
26+
artifact_exec_ext: .exe
27+
artifact_dlib_ext: .dll
28+
artifact_staticlib_ext: .lib
29+
# Note: I wanted to use env.BUILD_TYPE, but it isn't taking
30+
#artifact_out_dir: ${{ BUILD_TYPE }}/
31+
artifact_out_dir: Release/
32+
artifact_os_name: Windows
33+
artifact_arch: x86_64
34+
- os: macos-latest
35+
artifact_dlib_ext: .dylib
36+
artifact_staticlib_ext: .a
2137
steps:
2238
- uses: actions/checkout@v2
2339
- run: |
@@ -79,3 +95,46 @@ jobs:
7995
# Execute tests defined by the CMake configuration.
8096
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
8197
run: ./src/test/Release/Disassembler_TEST.exe
98+
- name: Prepare Binaries for upload (Mac\Linux)
99+
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macOS-latest'
100+
shell: bash
101+
run: |
102+
mkdir ${{github.workspace}}/artifacts
103+
cp build/src/libDisassembler${{ matrix.artifact_staticlib_ext }} ${{github.workspace}}/artifacts
104+
cp build/src/cli/disasm ${{github.workspace}}/artifacts
105+
cp build/src/gui/disasm-gui ${{github.workspace}}/artifacts
106+
cp build/plugins/xedPlugin/libxedPlugin${{ matrix.artifact_dlib_ext }} ${{github.workspace}}/artifacts
107+
pushd ${{github.workspace}}
108+
zip -r Gozihr-$(uname -s)-$(uname -m).zip artifacts
109+
popd
110+
- name: Prepare Binaries for upload (windows)
111+
if: matrix.os == 'windows-2019'
112+
shell: powershell
113+
run: |
114+
[system.io.directory]::CreateDirectory("${{github.workspace}}/artifacts")
115+
Copy-Item "build/src/${{ matrix.artifact_out_dir}}Disassembler${{ matrix.artifact_staticlib_ext }}" -Destination "${{github.workspace}}/artifacts"
116+
Copy-Item "build/src/cli/${{ matrix.artifact_out_dir }}disasm${{ matrix.artifact_exec_ext }}" -Destination "${{github.workspace}}/artifacts"
117+
Copy-Item "build/src/gui/${{ matrix.artifact_out_dir }}disasm-gui${{ matrix.artifact_exec_ext }}" -Destination "${{github.workspace}}/artifacts"
118+
Copy-Item "build/plugins/xedPlugin/${{ matrix.artifact_out_dir }}xedPlugin${{ matrix.artifact_dlib_ext }}" -Destination "${{github.workspace}}/artifacts"
119+
Compress-Archive -Path ${{github.workspace}}/artifacts/* -DestinationPath Gozihr-${{matrix.artifact_os_name}}-${{matrix.artifact_arch}}.zip
120+
- name: 'Upload Pull Request Artifact'
121+
uses: actions/upload-artifact@v3
122+
if: startsWith(github.ref, 'refs/pull/')
123+
with:
124+
name: Gozihr Pull Request Artifacts
125+
path: Gozihr-*.zip
126+
retention-days: 5
127+
- name: Set variables
128+
if: startsWith(github.ref, 'refs/heads/master')
129+
run: |
130+
APP=$(cat $GITHUB_WORKSPACE/src/version/AppName.txt)
131+
VER=$(cat $GITHUB_WORKSPACE/src/version/Version.txt)
132+
echo "VERSION=$VER" >> $GITHUB_ENV
133+
echo "APPNAME=$APP" >> $GITHUB_ENV
134+
- name: Upload binaries to Release
135+
uses: softprops/action-gh-release@v1
136+
if: startsWith(github.ref, 'refs/heads/master')
137+
with:
138+
tag_name: ${{ env.APPNAME }}-${{ env.VERSION }}
139+
files: |
140+
Gozihr-*.zip

0 commit comments

Comments
 (0)