diff --git a/.github/workflows/kubeflow.yml b/.github/workflows/kubeflow.yml new file mode 100644 index 0000000..5cd941f --- /dev/null +++ b/.github/workflows/kubeflow.yml @@ -0,0 +1,77 @@ +# Build, Publish and Release +name: Kubernetes Batchjob Connector + +on: + push: + branches: + - master + tags: + - 'v*' + +jobs: + + # Create Package + package: + + runs-on: ubuntu-latest + name: Package + + steps: + - uses: actions/checkout@v2 + + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: 3.1.x + + # Linux package + - name: Publish + run: dotnet publish KubeJobs/KubeJobs.csproj -c Release -o linuxoutput --self-contained -r linux-x64 + + - name: Tar Linux output folder + run: tar -cvzf ./kubernetes-batchjob-container-linux.tar.gz linuxoutput + + - name: Upload Linux artifact + uses: actions/upload-artifact@v2.2.2 + with: + name: kubernetes-batchjob-container-artifact + path: ./kubernetes-batchjob-container-linux.tar.gz + + # Windows package + - name: Publish + run: dotnet publish KubeJobs/KubeJobs.csproj -c Release -o winoutput --self-contained -r win-x64 + + - name: action-zip + uses: montudor/action-zip@v0.1.1 + with: + args: zip -qq -r ./kubernetes-batchjob-container-win.zip winoutput + + - name: Upload Win artifact + uses: actions/upload-artifact@v2.2.2 + with: + name: kubernetes-batchjob-container-artifact + path: ./kubernetes-batchjob-container-win.zip + + release: + + runs-on: ubuntu-latest + name: Release + needs: package + + steps: + - name: Download Package + uses: actions/download-artifact@v1 + with: + name: kubernetes-batchjob-container-artifact + path: ./ + + - name: Create Release + id: create_release + uses: actions/create-release@latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false