Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Commit ab9f36c

Browse files
committed
fix github workflows
now each workflow "flows" better. Each job is isolated from each other such that the nuget packages can still be released even if the tests fail. Signed-off-by: Matthew Fisher <matt.fisher@fermyon.com>
1 parent 4134a5e commit ab9f36c

File tree

5 files changed

+138
-167
lines changed

5 files changed

+138
-167
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Build and test application
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
runs-on: ${{ matrix.os }}
12+
defaults:
13+
run:
14+
shell: bash
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
build: [linux-debug, linux-release, macos-debug, macos-release, windows-debug, windows-release]
19+
include:
20+
- build: linux-debug
21+
os: ubuntu-latest
22+
config: debug
23+
- build: linux-release
24+
os: ubuntu-latest
25+
config: release
26+
- build: macos-debug
27+
os: macos-latest
28+
config: debug
29+
- build: macos-release
30+
os: macos-latest
31+
config: release
32+
- build: windows-debug
33+
os: windows-latest
34+
config: debug
35+
- build: windows-release
36+
os: windows-latest
37+
config: release
38+
39+
steps:
40+
- uses: actions/checkout@v2
41+
- name: Get Bindle source for testing
42+
uses: actions/checkout@v2
43+
with:
44+
repository: deislabs/bindle
45+
path: bindleserver
46+
ref: v0.8.0
47+
- name: Build Bindle
48+
run: make build
49+
working-directory: bindleserver
50+
- name: Setup .NET
51+
uses: actions/setup-dotnet@v1
52+
with:
53+
dotnet-version: 6.0.x
54+
- name: Restore dependencies
55+
run: dotnet restore
56+
- name: Set MINVERBUILDMETADATA
57+
run: echo MINVERBUILDMETADATA=$(git rev-parse --short ${GITHUB_SHA}) >> $GITHUB_ENV
58+
- name: Build
59+
run: dotnet build -c ${{ matrix.config }} --no-restore
60+
- name: Test
61+
env:
62+
BINDLE_SERVER_PATH: ../../../../../bindleserver/target/debug
63+
run: dotnet test -c ${{ matrix.config }} --no-build --verbosity normal

.github/workflows/build-and-test/action.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

.github/workflows/build-publish-release.yml

Lines changed: 0 additions & 139 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Publish packages
2+
3+
on:
4+
push:
5+
tags:
6+
- '[0-9]+.[0-9]+.[0-9]+'
7+
- '[0-9]+.[0-9]+.[0-9]+-preview'
8+
branches: [ main ]
9+
10+
jobs:
11+
publish:
12+
runs-on: ${{ matrix.os }}
13+
defaults:
14+
run:
15+
shell: bash
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
os: [ubuntu-latest, macos-latest, windows-latest]
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: Setup dotnet
23+
uses: actions/setup-dotnet@v1
24+
with:
25+
dotnet-version: 6.0.x
26+
- name: Restore dependencies
27+
run: dotnet restore
28+
- name: Set MINVERBUILDMETADATA
29+
run: echo MINVERBUILDMETADATA=$(git rev-parse --short ${GITHUB_SHA}) >> $GITHUB_ENV
30+
- name: Build
31+
run: dotnet build --configuration Release --no-restore
32+
- name: Publish Github Packages
33+
run: |
34+
for nupkg in $(find . -name *.nupkg)
35+
do
36+
echo Pushing $nupkg
37+
dotnet nuget push $nupkg --api-key ${{ secrets.GHPACKAGES_PAT }} --source https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json --skip-duplicate
38+
done
39+
- name: Publish Nuget Packages
40+
if: startsWith(github.ref, 'refs/tags/')
41+
run: |
42+
for nupkg in $(find . -name *.nupkg)
43+
do
44+
echo Pushing $nupkg
45+
dotnet nuget push $nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
46+
done

.github/workflows/release.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Create GitHub release
2+
3+
on:
4+
push:
5+
tags:
6+
- '[0-9]+.[0-9]+.[0-9]+'
7+
- '[0-9]+.[0-9]+.[0-9]+-preview'
8+
9+
jobs:
10+
release:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: "Build Changelog"
15+
id: github_release
16+
uses: mikepenz/release-changelog-builder-action@main
17+
with:
18+
configuration: ".github/workflows/configuration.json"
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21+
- name: Create Release
22+
uses: actions/create-release@v1
23+
with:
24+
tag_name: ${{ github.ref }}
25+
release_name: ${{ github.ref }}
26+
body: ${{ steps.github_release.outputs.changelog }}
27+
prerelease: ${{ contains(github.ref, '-preview') }}
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)