Skip to content

Commit

Permalink
Workflow refactoring (#76)
Browse files Browse the repository at this point in the history
Co-authored-by: Vianney de Bellabre <[email protected]>
  • Loading branch information
Djoums and Vianney de Bellabre authored Jun 24, 2024
1 parent e4a24c1 commit b955da4
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 52 deletions.
35 changes: 17 additions & 18 deletions .github/workflows/02-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,20 @@ jobs:
build-vsix:
runs-on: windows-latest
steps:
- run: echo "Skipped for now"
# - name: Restore versioned sources
# uses: actions/cache/restore@v4
# with:
# path: |
# !**/.git
# **/*
# key: cache-${{ github.sha }}
# enableCrossOsArchive: true
# - uses: actions/setup-dotnet@v4
# - run: dotnet restore VsixOnly.slnf
# - uses: microsoft/setup-msbuild@v2
# - run: msbuild VsixOnly.slnf "-p:OutputPath=..\..\vsix;Configuration=Release"
# - uses: actions/cache/save@v4
# with:
# path: vsix
# key: cache-${{ github.sha }}
# enableCrossOsArchive: true
- name: Restore versioned sources
uses: actions/cache/restore@v4
with:
path: |
!**/.git
**/*
key: cache-${{ github.sha }}
enableCrossOsArchive: true
- uses: actions/setup-dotnet@v4
- run: dotnet restore VsixOnly.slnf
- uses: microsoft/setup-msbuild@v2
- run: msbuild VsixOnly.slnf "-p:OutputPath=..\..\vsix;Configuration=Release"
- uses: actions/cache/save@v4
with:
path: vsix
key: cache-${{ github.sha }}
enableCrossOsArchive: true
38 changes: 18 additions & 20 deletions .github/workflows/03-publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish NuGet Package
name: Publish

on:
workflow_call:
Expand All @@ -19,14 +19,13 @@ jobs:
publish-nuget:
runs-on: ubuntu-latest
steps:
- run: echo "Skipped for now"
# - uses: actions/cache/restore@v4
# with:
# path: nupkg
# key: cache-${{ github.sha }}
# enableCrossOsArchive: true
# - run: echo "PACKAGE=$(find . -name 'EcoCode.${{ inputs.tag }}.nupkg' | head -n 1)" >> $GITHUB_ENV
# - run: dotnet nuget push ${{ env.PACKAGE }} -k "${{ secrets.nuget-api-key }}" -s https://api.nuget.org/v3/index.json
- uses: actions/cache/restore@v4
with:
path: nupkg
key: cache-${{ github.sha }}
enableCrossOsArchive: true
- run: echo "PACKAGE=$(find . -name 'EcoCode.${{ inputs.tag }}.nupkg' | head -n 1)" >> $GITHUB_ENV
- run: dotnet nuget push ${{ env.PACKAGE }} -k "${{ secrets.nuget-api-key }}" -s https://api.nuget.org/v3/index.json

publish-tool:
runs-on: ubuntu-latest
Expand All @@ -43,14 +42,13 @@ jobs:
if: ${{ inputs.tag == inputs.version }}
runs-on: windows-latest
steps:
- run: echo "Skipped for now"
# - uses: actions/cache/restore@v4
# with:
# path: vsix
# key: cache-${{ github.sha }}
# enableCrossOsArchive: true
# - uses: cezarypiatek/[email protected]
# with:
# extension-file: vsix/EcoCode.vsix
# publish-manifest-file: vsix/publishManifest.json
# personal-access-code: ${{ secrets.vsmarketplace-api-key }}
- uses: actions/cache/restore@v4
with:
path: vsix
key: cache-${{ github.sha }}
enableCrossOsArchive: true
- uses: cezarypiatek/[email protected]
with:
extension-file: vsix/EcoCode.vsix
publish-manifest-file: vsix/publishManifest.json
personal-access-code: ${{ secrets.vsmarketplace-api-key }}
17 changes: 7 additions & 10 deletions .github/workflows/04-release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Create Release
name: Release

on:
workflow_call:
Expand All @@ -24,11 +24,11 @@ jobs:
path: tool
key: cache-${{ github.sha }}
enableCrossOsArchive: true
# - uses: actions/cache/restore@v4
# with:
# path: vsix
# key: cache-${{ github.sha }}
# enableCrossOsArchive: true
- uses: actions/cache/restore@v4
with:
path: vsix
key: cache-${{ github.sha }}
enableCrossOsArchive: true
- uses: softprops/action-gh-release@v2
with:
tag_name: ${{ inputs.tag }}
Expand All @@ -39,7 +39,4 @@ jobs:
files: |
nupkg/**/EcoCode.${{ inputs.tag }}.nupkg
tool/**/EcoCode.Tool.${{ inputs.tag }}.nupkg
# files: |
# nupkg/**/EcoCode.${{ inputs.tag }}.nupkg
# tool/**/EcoCode.Tool.${{ inputs.tag }}.nupkg
# vsix/EcoCode.vsix
vsix/EcoCode.vsix
6 changes: 3 additions & 3 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Build and Test
on:
workflow_dispatch:
# push:
# branches:
# - 'main'
push:
branches:
- 'main'
pull_request:

permissions:
Expand Down
2 changes: 1 addition & 1 deletion src/EcoCode.Package/EcoCode.Package.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<IsPackable>true</IsPackable>
<IncludeBuildOutput>false</IncludeBuildOutput>
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<EnablePackageValidation>true</EnablePackageValidation>
<GenerateDependencyFile>false</GenerateDependencyFile>
<DevelopmentDependency>true</DevelopmentDependency>
Expand Down

0 comments on commit b955da4

Please sign in to comment.