I'm trying to create a .msi installer package with wix in a Azure Pipeline, when i run the program locally without the pipeline it works.. but when i try it on the pipeline with the .yaml file it doesnt works... i tried two ways
1-
name: $(BuildID)
trigger:
- master
pool:
vmImage: 'windows-latest'
variables:
buildConfiguration: 'Release'
steps:
- script: .\Tools\Wix\candle.exe -nologo Foobar.wxs -out Foobar.wixobj -ext WixUIExtension
displayName: 'Compile Wix file'
- script: .\Tools\Wix\light.exe -nologo Foobar.wixobj -out Foobar.msi -ext WixUIExtension
displayName: 'Create MSI file'
and 2- (Here i put the order of some packages)
name: $(BuildID)
trigger:
- master
pool:
vmImage: 'windows-latest'
variables:
buildConfiguration: 'Release'
steps:
- task: DotNetCoreCLI#2
inputs:
command: 'build'
projects: 'src\common\QENetwork.Contracts\QENetwork.Contracts.csproj'
arguments: '--configuration $(buildConfiguration)'
- task: DotNetCoreCLI#2
inputs:
command: 'build'
projects: 'src\common\QENetwork.Common\QENetwork.Common.csproj'
arguments: '--configuration $(buildConfiguration)'
- task: DotNetCoreCLI#2
inputs:
command: 'build'
projects: 'src\services\QENetwork.BusinessLayer\QENetwork.BusinessLayer.csproj'
arguments: '--configuration $(buildConfiguration)'
- task: DotNetCoreCLI#2
inputs:
command: 'build'
projects: 'src\common\QENetwork.Data\QENetwork.Data.csproj'
arguments: '--configuration $(buildConfiguration)'
- task: DotNetCoreCLI#2
inputs:
command: 'build'
projects: 'src\app\QENetwork.Infrastructure\QENetwork.Infrastructure.csproj'
arguments: '--configuration $(buildConfiguration)'
- task: DotNetCoreCLI#2
inputs:
command: 'build'
projects: 'src\services\QENetwork.DataLayer\QENetwork.DataLayer.csproj'
arguments: '--configuration $(buildConfiguration)'
- task: MSBuild#1
displayName: 'Build Installer'
inputs:
solution: 'src\app\installer\QENetworkSetup\QENetworkSetup.wixproj'
configuration: $(buildConfiguration)
maximumCpuCount: true
msbuildArguments: '/p:Configuration=Release/p:ProductCode=${product_code} /p:UpgradeCode=${upgrade_code}/t:Clean;Rebuild'
- task: CopyFiles#2
displayName: 'Copy installer'
inputs:
SourceFolder: '$(Build.SourcesDirectory)/src/app/installer/QENetworkSetup/'
Contents: 'QENetwork.msi'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts#1
displayName: 'publish installer'
inputs:
pathToPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: 'Installer'
Does someone know how to make it work?
Related
I am working on configuring a deployment pipeline for my team. We are using Github Actions and I have most of it sorted, but ran into an issue when trying to run certain steps in a sequential order.
The app is ASP.NET Core MVC with some Blazor support. We are using webpack, webpack-cli css-loader & style-loader to bundle and minify our CSS and JS files.
The issue: I need to be able to run the npm build task before the .net core publish task in github actions. I am able to get the steps to run sequentially HOWEVER, the files generated in step 1 (the npm build) don't seem to be available to the .net core publish actions which happens after.
Question: what do I need to do in order to have the newly generated npm build files be used by the .net core publish action? I assume its a matter of moving them around to the correct location, however I am having trouble finding any good info on this. I have done Much trial and error, and research has been unfruitful.
Below is the yaml file and webpack file being used, and the command run is just npm run build
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: .net Publish
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
job1:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [15.x]
steps:
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node#v3
with:
node-version: ${{ matrix.node-version }}
- name: build webpack
uses: actions/checkout#v1
- run: ls -a
- run: npm i
working-directory: ./ClientApp
- run: npm run build
working-directory: ./ClientApp
- run: pwd
- run: ls -a
- name: Persist npm build output
uses: actions/upload-artifact#v3
with:
name: npm-post-build
path: |
./wwwroot/dist/**
job2:
needs: job1
runs-on: ubuntu-latest
steps:
- name: Install Octopus Deploy CLI
uses: OctopusDeploy/install-octopus-cli-action#v1
with:
version: '*'
- uses: actions/checkout#v3
- name: Setup .NET
uses: actions/setup-dotnet#v3
with:
dotnet-version: 7.0.x
- name: Restore dependencies
run: dotnet restore
- name: replace dist with npm build artifact
uses: actions/download-artifact#v3
with:
name: npm-post-build
path: npm-post-build
- shell: bash
run: |
ls -a
rm -r wwwroot/dist
ls wwwroot
mv npm-post-build wwwroot/dist
ls wwwroot/dist
- name: Build
run: dotnet build --no-restore
- name: Publish
run: dotnet publish -p:PublishProfile=FolderProfile -o website
- name: package
run: |
shopt -s globstar
paths=()
for i in website/**; do
dir=${i%/*}
echo ${dir}
paths=(${paths[#]} ${dir})
done
eval uniquepaths=($(printf "%s\n" "${paths[#]}" | sort -u))
for i in "${uniquepaths[#]}"; do
echo $i
done
packages=()
versions=()
for path in "${uniquepaths[#]}"; do
dir=${path}/../../../..
parentdir=$(builtin cd $dir; pwd)
projectname=${parentdir##*/}
octo pack \
--basePath ${path} \
--id ${projectname} \
--version 1.0.0 \
--format zip \
--overwrite
packages=(${packages[#]} "${projectname}.1.0.0.zip")
versions=(${versions[#]} "${projectname}:1.0.0")
done
printf -v joined "%s," "${packages[#]}"
echo "::set-output name=artifacts::${joined%,}"
printf -v versionsjoinednewline "%s\n" "${versions[#]}"
versionsjoinednewline="${versionsjoinednewline//'%'/'%25'}"
versionsjoinednewline="${versionsjoinednewline//$'\n'/'%0A'}"
versionsjoinednewline="${versionsjoinednewline//$'\r'/'%0D'}"
echo "::set-output name=versions_new_line::${versionsjoinednewline%\n}"
echo "prepackage complete ${packages}"
- name: Push a package to Octopus Deploy
uses: OctopusDeploy/push-package-action#v3
env:
OCTOPUS_URL: https://****.octopus.app/
OCTOPUS_API_KEY: *****
OCTOPUS_SPACE: 'Default'
with:
overwrite_mode: OverwriteExisting
packages: runner.1.0.0.zip
const path = require('path');
module.exports = {
entry: {
site: '../wwwroot/js/site.js'
},
output: {
filename: '[name].entry.js',
path: path.resolve(__dirname, '..', 'wwwroot', 'dist')
},
devtool: 'source-map',
mode: 'development',
module: {
rules: [
{
test: /\.css$/,
use: ['style-loader', 'css-loader'],
},
{
test: /\.(eot|woff(2)?|ttf|otf|svg)$/i,
type: 'asset'
},
]
}
};
npm CI && npm run build is failing in github actions I'll paste the yaml file below.
name: Deploy to Firebase Hosting on PR
"on": pull_request
jobs:
build_and_preview:
if: "${{ github.event.pull_request.head.repo.full_name == github.repository }}"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout#v2
- run: npm ci && npm run build
- uses: FirebaseExtended/action-hosting-deploy#v0
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.SECRET }}"
projectId: projectId
enter image description here
I tried to remove npm CI, deleted node_modules package and package.json file in local and re-installed everything.
It looks like you don't have package-lock.json in the root directory.
You can add it using: npm i --package-lock-only
And try to set the ci to empty, eg:
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout#v3
- name: Install Dependencies
run: npm install
- name: Build
run: npm run build
env:
CI: ""
https://github.com/KillerJoke623/Practic
I've got a problem with my University practic, can you help me please
name: Jupyter
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout#v3
- name: Setup Python
uses: actions/setup-python#v4.0.0
with:
cache: pip
python-version: '3.7'
- name: Install Dependencies
run: pip install -r requirements.txt
- name: Exeute Notebook
run: jupyter-nbconvert --to html practic.ipynb
- name: Upload a Build Artifact
uses: actions/upload-artifact#v3.1.0
with:
name: Artifact
path: practic.html
I want to adapt the boilerplate code in the r-lib/actions repo to add a linting check to my (fake) package. I have my workflow yaml as follows:
on:
push:
branches:
- main
- master
pull_request:
branches:
- main
- master
name: lint
jobs:
lint:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./mystarwars
steps:
- uses: actions/checkout#v2
- uses: r-lib/actions/setup-r#v1
- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), "../.github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), "../.github/R-version")
shell: Rscript {0}
- name: Restore R package cache
uses: actions/cache#v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('../.github/R-version') }}-1-${{ hashFiles('../.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('../.github/R-version') }}-1-
- name: Install dependencies
run: |
install.packages(c("remotes"))
remotes::install_deps(dependencies = TRUE)
install.packages(c("lintr"))
shell: Rscript {0}
- name: Install package
run: R CMD INSTALL .
- name: Lint
run: lintr::lint_package()
shell: Rscript {0}
However, I get errors when trying to install lintr in the "Install dependencies". This step fails (silently), so then when it reaches the "Lint" step it fails with Error: Error in loadNamespace(x) : there is no package called ‘lintr’.
This remains the case whether I use install.packages(c("lintr")) or remotes::install_cran("lintr").
HERE is the full log of the "Install dependencies" step on GitHub Actions.
I have a devops yaml pipeline that runs DotNetCoreCLI#2 tasks to restore, build and test.
In the event, one or more tests fail I would like the pipeline to continue and publish the output ready for the devops release.
Initially, for a failed test the whole pipeline execution would report "Build Failed". After adding the following at the top of the build pipeline yaml:
jobs:
- job: Build
continueOnError: true
I now get "Build Partially Succeeded".
However, when I check the pipeline execution summary page, I see there are 0 artifacts:
How can I make the pipeline publish even if the tests fail?
For completeness, the full yaml is below
stages:
- stage: Build
jobs:
- job: Build
continueOnError: true
pool:
name: Hosted Windows 2019 with VS2019
demands:
- msbuild
- visualstudio
variables:
solution: '**/*.sln'
projects: '**/Interfaces.Avaloq.Presentation.AzureFunctions.csproj'
unitTestProjects: '**/*Testing.Unit*/*.csproj'
integrationTestProjects: '**/*Testing.Integration*/*.csproj'
buildPlatform: 'Any CPU'
buildConfiguration: 'Debug'
steps:
- script: |
- task: DotNetCoreCLI#2
displayName: Restore Functions
inputs:
command: restore
projects: '$(projects)'
feedsToUse: config
nugetConfigPath: nuget.config
- task: DotNetCoreCLI#2
displayName: Build Functions
inputs:
command: build
projects: '$(projects)'
arguments: '--configuration $(buildConfiguration)'
- task: DotNetCoreCLI#2
displayName: Restore Unit Tests
inputs:
command: restore
projects: '$(unitTestProjects)'
feedsToUse: config
nugetConfigPath: nuget.config
- task: DotNetCoreCLI#2
displayName: Build Unit Tests
inputs:
command: build
projects: '$(unitTestProjects)'
arguments: '--configuration $(buildConfiguration)'
- task: DotNetCoreCLI#2
displayName: Run Unit Tests
inputs:
command: 'test'
projects: '$(unitTestProjects)'
arguments: --filter Category!=ExcludeFromBVT
testRunTitle: 'Unit Tests'
feedsToUse: config
nugetConfigPath: nuget.config
- task: AzurePowerShell#4
inputs:
azureSubscription: 'Design Subscription (xxx)'
ScriptType: 'InlineScript'
Inline: |
Set-Location $env:AGENT_WORKFOLDER
Get-ChildItem -Recurse
azurePowerShellVersion: 'LatestVersion'
- task: DotNetCoreCLI#2
displayName: Publish
inputs:
command: publish
arguments: '--configuration $(buildConfiguration) --output $(build.artifactstagingdirectory)'
projects: '$(projects)'
publishWebProjects: false
zipAfterPublish: true
- task: PublishBuildArtifacts#1
displayName: 'Publish Artifact'
inputs:
PathtoPublish: '$(build.artifactstagingdirectory)'
condition: succeededOrFailed()
- task: PublishBuildArtifacts#1
displayName: 'Publish Artifact: ArmTemplate'
inputs:
PathtoPublish: Interfaces.Avaloq.Deployment
ArtifactName: RGDeploy
If your test are failing please add continueOnError: true on test step level. Adding it on job level causes that next (dependent) job will run. Please compare this:
continueOnError on job level:
continueOnError on step level: