Skip to content

Commit 1599fdb

Browse files
authored
Release script (#1)
1 parent 0384221 commit 1599fdb

File tree

13 files changed

+384
-0
lines changed

13 files changed

+384
-0
lines changed

.bazelignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
external
2+
dist

.bazelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@ build --incompatible_enable_cc_toolchain_resolution
44
build --incompatible_strict_action_env
55

66
build:windows --platforms=//bazel/platforms:windows
7+
build:windows --host_platform=//bazel/platforms:windows
78

89
build:linux --platforms=//bazel/platforms:linux
10+
build:linux --host_platform=//bazel/platforms:linux
911
build:linux --extra_toolchains=@llvm_toolchain//:cc-toolchain-x86_64-linux
1012

1113
common:ci --announce_rc
1214
common:ci --disk_cache=~/.cache/bazel-disk-cache
15+
build:ci -c opt
1316

1417
try-import %workspace%/user.bazelrc

.github/workflows/release.yml

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "[0-9]+.[0-9]+.[0-9]+"
7+
- "[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+"
8+
9+
jobs:
10+
release-draft:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: softprops/action-gh-release@v1
14+
15+
windows-x64-binaries:
16+
runs-on: windows-latest
17+
steps:
18+
- name: Get Home Directory
19+
id: get_home_dir
20+
run: echo "::set-output name=dir::$HOME"
21+
- uses: actions/cache@v3
22+
with:
23+
path: |
24+
/Users/runneradmin/AppData/Local/bazelisk
25+
/Users/runneradmin/.cache/bazel-disk-cache
26+
key: ${{runner.os}}-bazel-cache
27+
- uses: actions/checkout@v3
28+
- run: bazel run --config=ci //:copy_dist_bin
29+
- run: bazel run --config=ci //:copy_dist_codegen_plugins
30+
- uses: actions/upload-artifact@v3
31+
with:
32+
name: windows-x64-binaries
33+
path: dist
34+
linux-x64-binaries:
35+
runs-on: ubuntu-latest
36+
steps:
37+
- uses: actions/cache@v3
38+
with:
39+
path: |
40+
~/.cache/bazelisk
41+
~/.cache/bazel-disk-cache
42+
key: ${{runner.os}}-bazel-cache
43+
- uses: actions/checkout@v3
44+
- run: bazel run --config=ci //:copy_dist_bin
45+
- run: bazel run --config=ci //:copy_dist_codegen_plugins
46+
- uses: actions/upload-artifact@v3
47+
with:
48+
name: linux-x64-binaries
49+
path: dist
50+
51+
linux-x64-archive:
52+
runs-on: ubuntu-latest
53+
needs:
54+
- linux-x64-binaries
55+
steps:
56+
- uses: actions/download-artifact@v3
57+
with:
58+
name: linux-x64-binaries
59+
- run: tar -czf ecsact_sdk_${{github.ref_name}}_linux_x64.tar.gz bin include
60+
- uses: actions/upload-artifact@v3
61+
with:
62+
name: linux-x64-archive
63+
path: ecsact_sdk_${{github.ref_name}}_linux_x64.tar.gz
64+
65+
windows-x64-archive:
66+
runs-on: ubuntu-latest
67+
needs:
68+
- windows-x64-binaries
69+
steps:
70+
- uses: actions/download-artifact@v3
71+
with:
72+
name: windows-x64-binaries
73+
- run: >
74+
zip -r ecsact_sdk_${{github.ref_name}}_windows_x64.zip bin include
75+
- uses: actions/upload-artifact@v3
76+
with:
77+
name: windows-x64-archive
78+
path: ecsact_sdk_${{github.ref_name}}_windows_x64.zip
79+
80+
release-upload-linux-x64-archive:
81+
runs-on: ubuntu-latest
82+
needs:
83+
- release-draft
84+
- linux-x64-archive
85+
steps:
86+
- uses: actions/download-artifact@v3
87+
with:
88+
name: linux-x64-archive
89+
- uses: softprops/action-gh-release@v1
90+
with:
91+
fail_on_unmatched_files: true
92+
files: ecsact_sdk_${{github.ref_name}}_linux_x64.tar.gz
93+
94+
release-upload-windows-x64-archive:
95+
runs-on: ubuntu-latest
96+
needs:
97+
- release-draft
98+
- windows-x64-archive
99+
steps:
100+
- uses: actions/download-artifact@v3
101+
with:
102+
name: windows-x64-archive
103+
- uses: softprops/action-gh-release@v1
104+
with:
105+
fail_on_unmatched_files: true
106+
files: ecsact_sdk_${{github.ref_name}}_windows_x64.zip
107+
108+
release-finish:
109+
runs-on: ubuntu-latest
110+
needs:
111+
- release-upload-windows-x64-archive
112+
- release-upload-linux-x64-archive
113+
steps:
114+
- uses: softprops/action-gh-release@v1
115+
with:
116+
name: ${{github.ref_name}}
117+
generate_release_notes: true

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,10 @@
1111

1212
# ecsact codegen
1313
*.ecsact.*
14+
15+
# MSIX distribution folder
16+
/dist/*
17+
!/dist/AppxManifest.xml
18+
!/dist/images
19+
*.msix
20+
*.zip

BUILD.bazel

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
load("@bzlws//:index.bzl", "bzlws_copy")
2+
3+
bzlws_copy(
4+
name = "copy_dist_bin",
5+
srcs = [
6+
"//cli:ecsact",
7+
],
8+
out = "dist/bin/{FILENAME}",
9+
force = True,
10+
)
11+
12+
bzlws_copy(
13+
name = "copy_dist_include",
14+
srcs = [
15+
"@ecsact_runtime//:headers",
16+
],
17+
out = "dist/include/{FILEPATH}",
18+
force = True,
19+
)
20+
21+
bzlws_copy(
22+
name = "copy_dist_codegen_plugins",
23+
srcs = [
24+
"@ecsact_lang_cpp//cpp_header_codegen",
25+
"@ecsact_lang_cpp//cpp_systems_header_codegen",
26+
"@ecsact_lang_cpp//systems_header_codegen",
27+
"@ecsact_lang_csharp//csharp_codegen",
28+
],
29+
out = "dist/share/ecsact/plugins/{FILENAME}",
30+
force = True,
31+
)

CreateMsix.bat

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
@echo off
2+
3+
set /p "PASSWORD=Password: "
4+
5+
MSIXHeroCLI pack -d dist -p EcsactSdk.msix
6+
MSIXHeroCLI sign --file %USERPROFILE%\Documents\Certificates\Seaube.pfx -p %PASSWORD% EcsactSdk.msix

UploadMsix.ps1

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env pwsh
2+
3+
$ErrorActionPreference = 'Stop'
4+
5+
# GitHub requires TLS 1.2
6+
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
7+
8+
$LatestTag = (gh release list -L 1).split()[0]
9+
Write-Host "Latest Tag: $LatestTag"
10+
11+
$ArchiveUrl = "https://github.com/ecsact-dev/ecsact_sdk/releases/download/$($LatestTag)/ecsact_sdk_$($LatestTag)_windows_x64.zip"
12+
$ArchivePath = "ecsact_sdk_$($LatestTag)_windows_x64.zip"
13+
14+
Write-Host "Downloading $ArchiveUrl to $ArchivePath..."
15+
Invoke-WebRequest $ArchiveUrl -OutFile $ArchivePath -UseBasicParsing
16+
17+
git clean dist -dfx
18+
Write-Host "Extracting $ArchivePath to dist..."
19+
Expand-Archive -Path $ArchivePath -DestinationPath dist
20+
21+
((Get-Content -path .\dist\AppxManifest.xml -Raw) -replace '0.0.0.0-placeholder',"$($LatestTag).0") | Set-Content -Path .\dist\AppxManifest.xml
22+
23+
try {
24+
$MsixPath = "ecsact_sdk_$($LatestTag)_windows_x64.msix"
25+
$CertPassword = Read-Host "Cert Password"
26+
MSIXHeroCLI pack -d dist -p $MsixPath
27+
MSIXHeroCLI sign --file $env:USERPROFILE\Documents\Certificates\Seaube.pfx -p $CertPassword $MsixPath
28+
gh release upload $LatestTag $MsixPath
29+
} finally {
30+
git checkout .\dist\AppxManifest.xml
31+
}

WORKSPACE.bazel

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,41 @@ load("@boost//:index.bzl", "boost_http_archives")
2020

2121
boost_http_archives()
2222

23+
http_archive(
24+
name = "ecsact_parse",
25+
sha256 = "",
26+
strip_prefix = "ecsact_parse-41e73763ecf19b675efb9a23f9b3fe8cac10d7b4",
27+
url = "https://github.com/ecsact-dev/ecsact_parse/archive/41e73763ecf19b675efb9a23f9b3fe8cac10d7b4.zip",
28+
)
29+
30+
http_archive(
31+
name = "ecsact_runtime",
32+
sha256 = "edf15d37e509163d0d1d8edad71536d125674f1757dacb338e7a665961788262",
33+
strip_prefix = "ecsact_runtime-6c5afb2032b9ec343bd17e1da4d658d1a5c3429b",
34+
url = "https://github.com/ecsact-dev/ecsact_runtime/archive/6c5afb2032b9ec343bd17e1da4d658d1a5c3429b.zip",
35+
)
36+
37+
http_archive(
38+
name = "ecsact_parse_runtime_interop",
39+
sha256 = "d87bdae35c2d3d3d0588835adcb9137a9de123feebc95fad903b3277903ffa60",
40+
strip_prefix = "ecsact_parse_runtime_interop-f3ff60a7d13bacd139b01073fb7feb68496860dc",
41+
url = "https://github.com/ecsact-dev/ecsact_parse_runtime_interop/archive/f3ff60a7d13bacd139b01073fb7feb68496860dc.zip",
42+
)
43+
44+
http_archive(
45+
name = "ecsact_lang_cpp",
46+
sha256 = "8a430ca8c92937403c0f879eca2a29da97662abd03901d11d8b419d97fa029b8",
47+
strip_prefix = "ecsact_lang_cpp-bb88f875b3300f795ce72feab1b30109af9bbc64",
48+
url = "https://github.com/ecsact-dev/ecsact_lang_cpp/archive/bb88f875b3300f795ce72feab1b30109af9bbc64.zip",
49+
)
50+
51+
http_archive(
52+
name = "ecsact_lang_csharp",
53+
sha256 = "abaec7f347a4bb02017df4e85a9a2f74f54c2397fbc1f2277622d9517ff8c371",
54+
strip_prefix = "ecsact_lang_csharp-8dc906f95836e1ea90b3644dae6e2890c10237b8",
55+
url = "https://github.com/ecsact-dev/ecsact_lang_csharp/archive/8dc906f95836e1ea90b3644dae6e2890c10237b8.zip",
56+
)
57+
2358
load("@ecsact_parse//:repositories.bzl", "ecsact_parse_dependencies")
2459

2560
ecsact_parse_dependencies()
@@ -31,6 +66,28 @@ http_archive(
3166
url = "https://github.com/google/googletest/archive/25cc5777a17820a6339204a3552aa1dd5e428669.zip",
3267
)
3368

69+
http_archive(
70+
name = "bzlws",
71+
sha256 = "9f52b3f339fb42e5a663b379eda56723fafb27c0fb3113152ee3a9229b059080",
72+
strip_prefix = "bzlws-4042efa29a0359cf13f1b64e0bcd560c2d1dc4c2",
73+
url = "https://github.com/zaucy/bzlws/archive/4042efa29a0359cf13f1b64e0bcd560c2d1dc4c2.zip",
74+
)
75+
76+
load("@bzlws//:repo.bzl", "bzlws_deps")
77+
78+
bzlws_deps()
79+
80+
http_archive(
81+
name = "rules_7zip",
82+
sha256 = "29ba984e2a7d48540faa839efaf09be4b880d211a93575e7ac87abffc12dbdea",
83+
strip_prefix = "rules_7zip-25d3b858a37580dbc1f1ced002e210be15012e2f",
84+
urls = ["https://github.com/zaucy/rules_7zip/archive/25d3b858a37580dbc1f1ced002e210be15012e2f.zip"],
85+
)
86+
87+
load("@rules_7zip//:setup.bzl", "setup_7zip")
88+
89+
setup_7zip()
90+
3491
http_archive(
3592
name = "hedron_compile_commands",
3693
sha256 = "c192482fc1d76eeec2c92d1dced179122b6bd2895ca0e7239aa4866ece7e096c",

dist/AppxManifest.xml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:uap5="http://schemas.microsoft.com/appx/manifest/uap/windows10/5" xmlns:iot="http://schemas.microsoft.com/appx/manifest/iot/windows10" xmlns:com2="http://schemas.microsoft.com/appx/manifest/com/windows10/2" xmlns:f2="http://schemas.microsoft.com/appx/manifest/foundation/windows10/2" xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10" xmlns:desktop3="http://schemas.microsoft.com/appx/manifest/desktop/windows10/3" xmlns:rescap2="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities/2" xmlns:rescap3="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities/3" xmlns:uap2="http://schemas.microsoft.com/appx/manifest/uap/windows10/2" xmlns:uap4="http://schemas.microsoft.com/appx/manifest/uap/windows10/4" xmlns:ray="http://schemas.raynet.de/msix/manifestextension" xmlns:rescap4="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities/4" xmlns:uap7="http://schemas.microsoft.com/appx/manifest/uap/windows10/7" xmlns:uap6="http://schemas.microsoft.com/appx/manifest/uap/windows10/6" xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3" xmlns:desktop4="http://schemas.microsoft.com/appx/manifest/desktop/windows10/4" xmlns:com="http://schemas.microsoft.com/appx/manifest/com/windows10" xmlns:rescap6="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities/6" xmlns:desktop2="http://schemas.microsoft.com/appx/manifest/desktop/windows10/2" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:build="http://schemas.microsoft.com/developer/appx/2015/build" xmlns:uap8="http://schemas.microsoft.com/appx/manifest/uap/windows10/8" xmlns:desktop10="http://schemas.microsoft.com/appx/manifest/desktop/windows10/10" xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities">
3+
<Identity Name="EcsactSdk" Version="0.0.0.0-placeholder" Publisher="CN=Seaube, C=Canada" />
4+
<Properties>
5+
<DisplayName>Ecsact SDK</DisplayName>
6+
<PublisherDisplayName>Seaube</PublisherDisplayName>
7+
<Logo>images\logo.png</Logo>
8+
<Description>Ecsact development tools and runtime headers. https://ecsact.dev</Description>
9+
</Properties>
10+
<Resources>
11+
<Resource Language="en-us" />
12+
</Resources>
13+
<Dependencies>
14+
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.18362.0" />
15+
</Dependencies>
16+
<Applications>
17+
<Application Id="EcsactSdk.Ecsact" Executable="bin/ecsact.exe" EntryPoint="Windows.FullTrustApplication">
18+
<uap3:VisualElements DisplayName="Ecsact CLI" Description="Ecsact Command Line Interface" BackgroundColor="transparent" Square44x44Logo="images/logo44.png" Square150x150Logo="images/logo150.png" AppListEntry="none" VisualGroup="Ecsact" />
19+
<Extensions>
20+
<uap3:Extension Category="windows.appExecutionAlias">
21+
<uap3:AppExecutionAlias>
22+
<uap8:ExecutionAlias Alias="ecsact.exe" />
23+
</uap3:AppExecutionAlias>
24+
</uap3:Extension>
25+
</Extensions>
26+
</Application>
27+
</Applications>
28+
<Capabilities>
29+
<rescap:Capability Name="runFullTrust" />
30+
</Capabilities>
31+
</Package>

dist/images/logo.png

72.5 KB
Loading

0 commit comments

Comments
 (0)