Skip to content

Commit 0c4cd4e

Browse files
committed
initial code commit
1 parent fe03273 commit 0c4cd4e

File tree

10 files changed

+523
-0
lines changed

10 files changed

+523
-0
lines changed
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
name: Generate Release
2+
3+
on:
4+
push:
5+
tags: [ '*.*.*' ]
6+
workflow_dispatch:
7+
inputs:
8+
name:
9+
description: 'Release Name'
10+
required: false
11+
default: ''
12+
type: string
13+
tag:
14+
description: 'Tag'
15+
required: false
16+
default: ''
17+
type: string
18+
is-draft:
19+
description: 'Draft'
20+
required: false
21+
default: false
22+
type: boolean
23+
is-prerelease:
24+
description: 'Pre-Release'
25+
required: false
26+
default: false
27+
type: boolean
28+
autogenerate:
29+
description: 'Autogenerate Release Notes'
30+
required: false
31+
default: false
32+
type: boolean
33+
body:
34+
description: 'Description'
35+
required: false
36+
default: ''
37+
38+
env:
39+
# [PROJECT_NAME]
40+
# Currently this is used for the following scenarios:
41+
# - Build Subdirectory Name
42+
# - Archive Name Prefix
43+
PROJECT_NAME: 'gitor'
44+
# [BINARY_NAME]
45+
# The name of the binary executable file, excluding extensions.
46+
# If this is blank, the value specified by '$PROJECT_NAME' is used instead. (See the 'Configure Environment' step.)
47+
BINARY_NAME: ''
48+
BUILD_TYPE: Release
49+
GET_VERSION_NUMBER_ARGS: "--version --quiet"
50+
51+
jobs:
52+
create-binaries:
53+
runs-on: ${{matrix.os}}
54+
strategy:
55+
matrix:
56+
os: [ windows-latest ]
57+
fail-fast: true
58+
59+
steps:
60+
# Check out the repository
61+
- uses: actions/checkout@v3
62+
with:
63+
submodules: recursive
64+
fetch-depth: 0
65+
66+
# Set up platform dependencies
67+
# Ninja
68+
- uses: seanmiddleditch/gha-setup-ninja@master
69+
# MSVC (Windows)
70+
- if: ${{ runner.os == 'Windows' }}
71+
uses: ilammy/msvc-dev-cmd@v1
72+
# gcc-10 g++-10 zip unzip (Linux)
73+
- if: ${{ runner.os == 'Linux' }}
74+
run: sudo apt-get update && sudo apt-get install gcc-10 g++-10 zip unzip -y
75+
76+
77+
# Configure CMake Cache
78+
# Windows
79+
- name: Configure CMake (Windows)
80+
if: ${{ runner.os == 'Windows' }}
81+
run: cmake -B '${{github.workspace}}/build' -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -G Ninja
82+
# Linux/macOS
83+
- name: Configure CMake (Linux/macOS)
84+
if: ${{ runner.os != 'Windows' }}
85+
run: cmake -B '${{github.workspace}}/build' -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -G Ninja
86+
env:
87+
CC: gcc-10
88+
CXX: g++-10
89+
90+
# Build Binary
91+
- name: Build
92+
run: cmake --build '${{github.workspace}}/build' --config '${{env.BUILD_TYPE}}'
93+
94+
# Create Packaged Release Archive
95+
# Windows
96+
- name: Create Archive (Windows)
97+
if: ${{ runner.os == 'Windows' }}
98+
run: |
99+
cd "${{github.workspace}}/build/${{env.PROJECT_NAME}}"
100+
Compress-Archive "${{env.BINARY_NAME || env.PROJECT_NAME}}.exe" "${{env.PROJECT_NAME}}-$(.\${{env.PROJECT_NAME}} ${{env.GET_VERSION_NUMBER_ARGS}})-Windows.zip"
101+
shell: powershell
102+
# Linux / macOS
103+
- name: Create Archive (Linux/macOS)
104+
if: ${{ runner.os != 'Windows' }}
105+
run: |
106+
cd "${{github.workspace}}/build/${{env.PROJECT_NAME}}"
107+
zip -T9 "${{env.PROJECT_NAME}}-$(./${{env.PROJECT_NAME}} ${{env.GET_VERSION_NUMBER_ARGS}})-${{runner.os}}.zip" "${{env.BINARY_NAME || env.PROJECT_NAME}}"
108+
shell: bash
109+
110+
# Upload Artifact
111+
- name: Upload Artifact
112+
uses: actions/upload-artifact@v2
113+
with:
114+
name: latest-${{runner.os}}
115+
path: '${{github.workspace}}/build/${{env.PROJECT_NAME}}/*.zip'
116+
#:create-binaries
117+
118+
create-release:
119+
needs: create-binaries
120+
runs-on: ubuntu-latest
121+
122+
steps:
123+
# Download Artifacts
124+
- name: 'Download Build Artifacts'
125+
uses: actions/download-artifact@v2
126+
127+
# Retrieve the latest git tag if this was triggered by a tag
128+
- name: 'Get Release Tag'
129+
id: get_version
130+
run: |
131+
if [ "${{github.event.inputs.tag}}" == "" ]; then TAG="${GITHUB_REF/refs\/tags\//}"; else TAG="${{github.event.inputs.tag}}" ; fi
132+
echo ::set-output name=VERSION::$TAG
133+
echo ::set-output name=NAME::"Release $TAG"
134+
135+
# Stage downloaded build artifacts for deployment
136+
- name: 'Stage Archives'
137+
run: |
138+
cd ${{github.workspace}}
139+
if mv ./latest-*/* ./ ; then ls -lAgh ; else ls -lAghR ; fi
140+
shell: bash
141+
142+
# Upload Release
143+
- name: 'Create Release'
144+
#if: ${{ github.event_name == 'workflow_dispatch' }}
145+
uses: softprops/action-gh-release@v1
146+
with:
147+
draft: ${{ github.event.inputs.is-draft || false }}
148+
prerelease: ${{ github.event.inputs.is-prerelease || false }}
149+
tag_name: ${{ steps.get_version.outputs.VERSION }}
150+
name: ${{ steps.get_version.outputs.NAME }}
151+
generate_release_notes: ${{ github.event.inputs.autogenerate || true }}
152+
body: ${{ github.event.inputs.body || '' }}
153+
fail_on_unmatched_files: true
154+
files: ${{github.workspace}}/*.zip
155+
#:create-release

.gitignore

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,37 @@ install_manifest.txt
99
compile_commands.json
1010
CTestTestfile.cmake
1111
_deps
12+
13+
#Ignore thumbnails created by Windows
14+
Thumbs.db
15+
#Ignore files built by Visual Studio
16+
*.obj
17+
*.exe
18+
*.pdb
19+
*.user
20+
*.aps
21+
*.pch
22+
*.vspscc
23+
*_i.c
24+
*_p.c
25+
*.ncb
26+
*.suo
27+
*.tlb
28+
*.tlh
29+
*.bak
30+
*.cache
31+
*.ilk
32+
*.log
33+
[Bb]in
34+
[Dd]ebug*/
35+
*.lib
36+
*.sbr
37+
obj/
38+
[Rr]elease*/
39+
_ReSharper*/
40+
[Tt]est[Rr]esult*
41+
.vs/
42+
#Nuget packages folder
43+
packages/
44+
out/
45+
/gitor/rc/version.h

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "307lib"]
2+
path = 307lib
3+
url = https://github.com/radj307/307lib

307lib

Submodule 307lib added at 9b85122

CMakeLists.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# git-open-remote/
2+
cmake_minimum_required (VERSION 3.20)
3+
4+
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/307lib/307modules")
5+
6+
set(ENV{gitor_VERSION} "0.0.0")
7+
include(VersionTag)
8+
GET_VERSION_TAG("${CMAKE_CURRENT_SOURCE_DIR}" "gitopenremote")
9+
10+
project ("git-open-remote" VERSION "${gitopenremote_VERSION}" LANGUAGES CXX)
11+
12+
add_subdirectory("307lib")
13+
add_subdirectory("gitor")

0 commit comments

Comments
 (0)