Skip to content

Commit

Permalink
Merge pull request #16 from bacongobbler/fix-workflows
Browse files Browse the repository at this point in the history
fix github workflows
  • Loading branch information
bacongobbler authored Apr 29, 2022
2 parents 4134a5e + ab9f36c commit cbbbf15
Show file tree
Hide file tree
Showing 5 changed files with 138 additions and 167 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Build and test application

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

jobs:
build:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
build: [linux-debug, linux-release, macos-debug, macos-release, windows-debug, windows-release]
include:
- build: linux-debug
os: ubuntu-latest
config: debug
- build: linux-release
os: ubuntu-latest
config: release
- build: macos-debug
os: macos-latest
config: debug
- build: macos-release
os: macos-latest
config: release
- build: windows-debug
os: windows-latest
config: debug
- build: windows-release
os: windows-latest
config: release

steps:
- uses: actions/checkout@v2
- name: Get Bindle source for testing
uses: actions/checkout@v2
with:
repository: deislabs/bindle
path: bindleserver
ref: v0.8.0
- name: Build Bindle
run: make build
working-directory: bindleserver
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore
- name: Set MINVERBUILDMETADATA
run: echo MINVERBUILDMETADATA=$(git rev-parse --short ${GITHUB_SHA}) >> $GITHUB_ENV
- name: Build
run: dotnet build -c ${{ matrix.config }} --no-restore
- name: Test
env:
BINDLE_SERVER_PATH: ../../../../../bindleserver/target/debug
run: dotnet test -c ${{ matrix.config }} --no-build --verbosity normal
28 changes: 0 additions & 28 deletions .github/workflows/build-and-test/action.yml

This file was deleted.

139 changes: 0 additions & 139 deletions .github/workflows/build-publish-release.yml

This file was deleted.

46 changes: 46 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Publish packages

on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+-preview'
branches: [ main ]

jobs:
publish:
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Restore dependencies
run: dotnet restore
- name: Set MINVERBUILDMETADATA
run: echo MINVERBUILDMETADATA=$(git rev-parse --short ${GITHUB_SHA}) >> $GITHUB_ENV
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Publish Github Packages
run: |
for nupkg in $(find . -name *.nupkg)
do
echo Pushing $nupkg
dotnet nuget push $nupkg --api-key ${{ secrets.GHPACKAGES_PAT }} --source https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json --skip-duplicate
done
- name: Publish Nuget Packages
if: startsWith(github.ref, 'refs/tags/')
run: |
for nupkg in $(find . -name *.nupkg)
do
echo Pushing $nupkg
dotnet nuget push $nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
done
29 changes: 29 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Create GitHub release

on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+-preview'

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: "Build Changelog"
id: github_release
uses: mikepenz/release-changelog-builder-action@main
with:
configuration: ".github/workflows/configuration.json"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
uses: actions/create-release@v1
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body: ${{ steps.github_release.outputs.changelog }}
prerelease: ${{ contains(github.ref, '-preview') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit cbbbf15

Please sign in to comment.