redforce04
redforce04
CC#
Created by redforce04 on 2/6/2023 in #help
❔ [Compiler Help] [GitLab CI/CD]
here is the file after cat:
public static class AssemblyInfo
{
public const string CommitHash = "9cfd23c0";
public const string CommitBranch = "dev";
}
public static class AssemblyInfo
{
public const string CommitHash = "9cfd23c0";
public const string CommitBranch = "dev";
}
10 replies
CC#
Created by redforce04 on 2/6/2023 in #help
❔ [Compiler Help] [GitLab CI/CD]
public static class AssemblyInfo
{
public const string CommitHash = "${CI_COMMIT_SHORT_SHA}";
public const string CommitBranch = "${CI_COMMIT_BRANCH}";
}
public static class AssemblyInfo
{
public const string CommitHash = "${CI_COMMIT_SHORT_SHA}";
public const string CommitBranch = "${CI_COMMIT_BRANCH}";
}
10 replies
CC#
Created by redforce04 on 2/6/2023 in #help
❔ [Compiler Help] [GitLab CI/CD]
it basically overwrites this file:
10 replies
CC#
Created by redforce04 on 2/6/2023 in #help
❔ [Compiler Help] [GitLab CI/CD]
I use envsubst < PWProfiler/AssemblyInfo.cs | sponge PWProfiler/AssemblyInfo.cs to replace the variable and overwrite it
10 replies
CC#
Created by redforce04 on 2/6/2023 in #help
❔ [Compiler Help] [GitLab CI/CD]
I used cat to verify the file was updated, and it seemed to look fine
10 replies
CC#
Created by redforce04 on 2/6/2023 in #help
❔ [Compiler Help] [GitLab CI/CD]
Here is my gitlab ci cd file (mostly stripped of comments):
image: redforce04/discordbot:netdataslbuilder
stages:
- build

variables:
OBJECTS_DIRECTORY: 'obj'
NUGET_PACKAGES_DIRECTORY: '.nuget'
SOURCE_CODE_PATH: '*/'

cache:
key: "$CI_JOB_STAGE-$CI_COMMIT_REF_SLUG"
paths:
- '$SOURCE_CODE_PATH$OBJECTS_DIRECTORY/project.assets.json'
- '$SOURCE_CODE_PATH$OBJECTS_DIRECTORY/*.csproj.nuget.*'
- '$NUGET_PACKAGES_DIRECTORY'
policy: pull-push

before_script:
- 'dotnet restore --packages $NUGET_PACKAGES_DIRECTORY'

build:
stage: build
script:
- 'envsubst < PWProfiler/AssemblyInfo.cs | sponge PWProfiler/AssemblyInfo.cs'
- 'dotnet publish -c Release --no-restore'
- 'mv PWProfiler/bin/Debug/PWProfiler.dll PWProfiler.dll'
artifacts:
name: "Build Results"
paths:
- PWProfiler.dll

image: redforce04/discordbot:netdataslbuilder
stages:
- build

variables:
OBJECTS_DIRECTORY: 'obj'
NUGET_PACKAGES_DIRECTORY: '.nuget'
SOURCE_CODE_PATH: '*/'

cache:
key: "$CI_JOB_STAGE-$CI_COMMIT_REF_SLUG"
paths:
- '$SOURCE_CODE_PATH$OBJECTS_DIRECTORY/project.assets.json'
- '$SOURCE_CODE_PATH$OBJECTS_DIRECTORY/*.csproj.nuget.*'
- '$NUGET_PACKAGES_DIRECTORY'
policy: pull-push

before_script:
- 'dotnet restore --packages $NUGET_PACKAGES_DIRECTORY'

build:
stage: build
script:
- 'envsubst < PWProfiler/AssemblyInfo.cs | sponge PWProfiler/AssemblyInfo.cs'
- 'dotnet publish -c Release --no-restore'
- 'mv PWProfiler/bin/Debug/PWProfiler.dll PWProfiler.dll'
artifacts:
name: "Build Results"
paths:
- PWProfiler.dll

10 replies
CC#
Created by redforce04 on 2/6/2023 in #help
❔ [Compiler Help] [GitLab CI/CD]
The other app is dotnet framework 4.8.1
10 replies
CC#
Created by redforce04 on 2/6/2023 in #help
❔ [Compiler Help] [GitLab CI/CD]
I want to update these right before compilation because one of the apps is dotnet 7.0 native aot and since it doesn't have reflection, I need a simpler solution
10 replies