Skip to content

Commit

Permalink
ci: Add release binaries (#2)
Browse files Browse the repository at this point in the history
Adds release binaries for the following targets

- aarch64-unknown-linux-gnu
- aarch64-unknown-linux-musl
- x86_64-apple-darwin
- x86_64-pc-windows-gnu
- x86_64-unknown-linux-gnu
- x86_64-unknown-linux-musl
  • Loading branch information
MAHDTech authored Jun 1, 2023
1 parent 77964eb commit 9b37086
Show file tree
Hide file tree
Showing 93 changed files with 7,388 additions and 11,728 deletions.
72 changes: 72 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
##################################################
# Notes
# rustc --print target-list
# https://doc.rust-lang.org/reference/linkage.html
##################################################

##################################################
[build]
##################################################

##################################################
[rust]
##################################################

channel = "stable"
lld = true

##################################################
[target.x86_64-apple-darwin]
##################################################

linker = "clang"

rustflags = []

##################################################
[target.x86_64-unknown-linux-gnu]
##################################################

linker = "clang"

rustflags = ["-C", "link-arg=-fuse-ld=lld"]

##################################################
[target.x86_64-unknown-linux-musl]
##################################################

linker = "clang"

rustflags = ["-C", "link-arg=-fuse-ld=lld", "-C", "relocation-model=static"]

##################################################
[target.aarch64-unknown-linux-gnu]
##################################################

linker = "aarch64-linux-gnu-gcc"

rustflags = []

##################################################
[target.aarch64-unknown-linux-musl]
##################################################

linker = "aarch64-linux-musl-gcc"

rustflags = ["-C", "relocation-model=static"]

##################################################
[target.x86_64-pc-windows-gnu]
##################################################

linker = "x86_64-w64-mingw32-gcc"

rustflags = []

##################################################
[target.x86_64-pc-windows-msvc]
##################################################

linker = "lld-link.exe"

rustflags = ["-C", "link-arg=-fuse-ld=lld"]
3 changes: 2 additions & 1 deletion .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ nix_direnv_watch_file devenv.nix
nix_direnv_watch_file devenv.lock
nix_direnv_watch_file devenv.yaml

use_flake --impure .#${PROJECT_SHELL}
#use_flake --impure .#${PROJECT_SHELL}
use_flake --impure .#

export PROJECT_NAME
export PROJECT_SHELL
Expand Down
39 changes: 36 additions & 3 deletions .github/scripts/archive.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
For example; 'x86_64-apple-darwin, release'
.PARAMETER OutputDir
Optional output directory to use for the archive.
If not provided, defaults to current directory.
.PARAMETER LogLevel
Optional log level to use for the script output.
Expand Down Expand Up @@ -51,6 +57,11 @@
Creation Date: 17/06/2020
Purpose/Change: Initial script development
Version: 0.2
Author: [email protected]
Creation Date: 29/03/2023
Purpose/Change: Add parameter OutputDir
.EXAMPLE
./archive.ps1 -Target "${{ matrix.target }}"
Expand Down Expand Up @@ -185,6 +196,15 @@ Param(
[String]
$LogLevel = "Information",

# Parameter: OutputDir
[Parameter(
Mandatory = $False,
HelpMessage = "[OPTIONAL]: The output directory for the build."
)]
[ValidateNotNullOrEmpty()]
[String]
$OutputDir = "$PWD",

# Parameter: Project
[Parameter(
Mandatory = $False,
Expand Down Expand Up @@ -239,7 +259,7 @@ Begin {
$ScriptFileName = $ScriptInvocation.MyCommand.Name

# Script Version
$ScriptVersion = "0.1"
$ScriptVersion = "0.2"

# Set the Script Name so it can be used in logs, matching the filename with no extension
$ScriptName = [System.IO.Path]::GetFilenameWithoutExtension($ScriptFileName)
Expand Down Expand Up @@ -776,8 +796,8 @@ Begin {
}
Write-Log -LogLevel "Debug" -LogMessage "Project set to $Project"

# Define the archive name
$Archive = "$Project-$Target.zip"
# Define the full archive name
$Archive = "$OutputDir/$Project-$Target.zip"

# Define the release directory
$Release = "target/$Target/release"
Expand All @@ -794,6 +814,19 @@ Process {

Try {

# Make sure the output directory exists
If ( -not ( Test-Path -PathType Container -Path "$OutputDir" ) ) {

Write-Log -LogLevel "Information" -LogMessage "Creating output directory $OutputDir"

If ( $PScmdlet.ShouldProcess( "Directory", "Create Output Directory" ) ) {

New-Item -ItemType Directory -Path "$OutputDir" | Out-Null

}

}

# If the zip archive already exists, abort
If ( Test-Path "$Archive" ) {

Expand Down
Loading

0 comments on commit 9b37086

Please sign in to comment.