Skip to content

Commit

Permalink
Merge pull request #58 from flcdrg/switch-to-main
Browse files Browse the repository at this point in the history
Switch to 'main' branch
  • Loading branch information
flcdrg authored Apr 25, 2024
2 parents 82792e7 + 3d6d3fa commit 7b554fa
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 79 deletions.
154 changes: 77 additions & 77 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Build

on:
push:
branches: [ master ]
branches: [main]
pull_request:
branches: [ master ]
branches: [main]

jobs:
update_release_draft:
Expand All @@ -17,7 +17,7 @@ jobs:
Release_body: ${{ steps.create_release.outputs.body}}
Release_html_url: ${{ steps.create_release.outputs.html_url}}
Release_upload_url: ${{ steps.create_release.outputs.upload_url}}

permissions:
contents: write

Expand All @@ -40,7 +40,7 @@ jobs:
setCommonVars: true

- uses: release-drafter/release-drafter@v6
if: github.ref == 'refs/heads/master' # Running this action only for master branch
if: github.ref == 'refs/heads/main' # Running this action only for main branch
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -61,76 +61,76 @@ jobs:
Release_body: ${{ needs.update_release_draft.outputs.Release_body }}

steps:
- name: Dump needs context
env:
NEEDS_CONTEXT: ${{ toJson(needs) }}
run: echo "$NEEDS_CONTEXT"

- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup MSBuild.exe
uses: microsoft/[email protected]
- name: NuGet Restore
run: nuget restore

- name: Build
run: msbuild PowerShellWixExtension.sln
# NBGV is run as part of the build, so actions after here have access to NBGV_ env variables.

# For some reason, running msiexec from Pester doesn't work quite right.
- name: msiexec
run: |
Start-Process msiexec.exe -Wait -ArgumentList "/i Tests\PowerShellWixInlineScriptTest\bin\Release\PowerShellWixInlineScriptTest.msi /q /liwearucmopvx ${{ github.workspace }}\inlinescript-install.log"
Start-Process msiexec.exe -Wait -ArgumentList "/x Tests\PowerShellWixInlineScriptTest\bin\Release\PowerShellWixInlineScriptTest.msi /q /liwearucmopvx ${{ github.workspace }}\inlinescript-uninstall.log"
Start-Process msiexec.exe -Wait -ArgumentList "/i Tests\PowerShellWixTest\bin\Release\PowerShellWixTest.msi /q /liwearucmopvx ${{ github.workspace }}\script-install.log"
Start-Process msiexec.exe -Wait -ArgumentList "/x Tests\PowerShellWixTest\bin\Release\PowerShellWixTest.msi /q /liwearucmopvx ${{ github.workspace }}\script-uninstall.log"
- name: Pester
id: test_module
uses: zyborg/pester-tests-report@v1
with:
include_paths: tests
github_token: ${{ secrets.GITHUB_TOKEN }}
tests_fail_step: true

- uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: test logs
path: ${{ github.workspace }}\**\*.log

- name: Pack
run: nuget pack .\PowerShellWixExtension.nuspec -Version "$env:NBGV_NuGetPackageVersion" -Properties "Configuration=$env:Configuration;releasenotes=$env:Release_body"

- uses: actions/upload-artifact@v4
with:
name: nupkg
path: ${{ github.workspace }}\PowerShellWixExtension.${{ env.NBGV_NuGetPackageVersion }}.nupkg

- name: Remove existing release asset
uses: flcdrg/remove-release-asset-action@v4
if: github.ref == 'refs/heads/master' # Running this action only for master branch
with:
# The release id to remove asset from
release_id: ${{ needs.update_release_draft.outputs.Release_Id }}
# The name of the asset you want to remove
asset_name: PowerShellWixExtension.nupkg
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true

- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
if: github.ref == 'refs/heads/master' # Running this action only for master branch
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.update_release_draft.outputs.Release_upload_url }}
asset_path: ${{ github.workspace }}\PowerShellWixExtension.${{ env.NBGV_NuGetPackageVersion }}.nupkg
asset_name: PowerShellWixExtension.nupkg
asset_content_type: application/octet-stream
- name: Dump needs context
env:
NEEDS_CONTEXT: ${{ toJson(needs) }}
run: echo "$NEEDS_CONTEXT"

- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup MSBuild.exe
uses: microsoft/[email protected]

- name: NuGet Restore
run: nuget restore

- name: Build
run: msbuild PowerShellWixExtension.sln
# NBGV is run as part of the build, so actions after here have access to NBGV_ env variables.

# For some reason, running msiexec from Pester doesn't work quite right.
- name: msiexec
run: |
Start-Process msiexec.exe -Wait -ArgumentList "/i Tests\PowerShellWixInlineScriptTest\bin\Release\PowerShellWixInlineScriptTest.msi /q /liwearucmopvx ${{ github.workspace }}\inlinescript-install.log"
Start-Process msiexec.exe -Wait -ArgumentList "/x Tests\PowerShellWixInlineScriptTest\bin\Release\PowerShellWixInlineScriptTest.msi /q /liwearucmopvx ${{ github.workspace }}\inlinescript-uninstall.log"
Start-Process msiexec.exe -Wait -ArgumentList "/i Tests\PowerShellWixTest\bin\Release\PowerShellWixTest.msi /q /liwearucmopvx ${{ github.workspace }}\script-install.log"
Start-Process msiexec.exe -Wait -ArgumentList "/x Tests\PowerShellWixTest\bin\Release\PowerShellWixTest.msi /q /liwearucmopvx ${{ github.workspace }}\script-uninstall.log"
- name: Pester
id: test_module
uses: zyborg/pester-tests-report@v1
with:
include_paths: tests
github_token: ${{ secrets.GITHUB_TOKEN }}
tests_fail_step: true

- uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: test logs
path: ${{ github.workspace }}\**\*.log

- name: Pack
run: nuget pack .\PowerShellWixExtension.nuspec -Version "$env:NBGV_NuGetPackageVersion" -Properties "Configuration=$env:Configuration;releasenotes=$env:Release_body"

- uses: actions/upload-artifact@v4
with:
name: nupkg
path: ${{ github.workspace }}\PowerShellWixExtension.${{ env.NBGV_NuGetPackageVersion }}.nupkg

- name: Remove existing release asset
uses: flcdrg/remove-release-asset-action@v4
if: github.ref == 'refs/heads/main' # Running this action only for main branch
with:
# The release id to remove asset from
release_id: ${{ needs.update_release_draft.outputs.Release_Id }}
# The name of the asset you want to remove
asset_name: PowerShellWixExtension.nupkg
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true

- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
if: github.ref == 'refs/heads/main' # Running this action only for master branch
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.update_release_draft.outputs.Release_upload_url }}
asset_path: ${{ github.workspace }}\PowerShellWixExtension.${{ env.NBGV_NuGetPackageVersion }}.nupkg
asset_name: PowerShellWixExtension.nupkg
asset_content_type: application/octet-stream
4 changes: 2 additions & 2 deletions version.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/main/src/NerdBank.GitVersioning/version.schema.json",
"version": "3.0",
"publicReleaseRefSpec": [
"^refs/heads/master$",
"^refs/heads/main$",
"^refs/heads/v\\d+(?:\\.\\d+)?$"
],
"nugetPackageVersion": {
Expand Down

0 comments on commit 7b554fa

Please sign in to comment.