Revert for now #70
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: 8.0.x | |
- name: Install dependencies | |
run: dotnet restore | |
- name: Build win-x64 | |
run: dotnet publish CentralisedPackageConverter.sln -c Release --runtime win-x64 --self-contained -o cent-pack-convert-win-x64 /p:AssemblyVersion=1.0.${{ github.run_number }} | |
- name: Build linux-x64 | |
run: dotnet publish CentralisedPackageConverter.sln -c Release --runtime linux-x64 --self-contained -o cent-pack-convert-linux-x64 /p:AssemblyVersion=1.0.${{ github.run_number }} | |
- name: Build osx-x64 | |
run: dotnet publish CentralisedPackageConverter.sln -c Release --runtime osx-x64 --self-contained -o cent-pack-convert-osx-x64 /p:AssemblyVersion=1.0.${{ github.run_number }} | |
- name: Pack .NET Core tool | |
run: dotnet pack -c Release CentralisedPackageConverter.sln /p:Version=1.0.${{ github.run_number }} | |
- name: Pack executables | |
shell: bash | |
run: | | |
7z a -tzip "./artifacts/cent-pack-convert-win-x64.zip" "./cent-pack-convert-win-x64/*" | |
tar czvf "./artifacts/cent-pack-convert-linux-x64.tar.gz" "cent-pack-convert-linux-x64" | |
tar czvf "./artifacts/cent-pack-convert-osx-x64.tar.gz" "cent-pack-convert-osx-x64" | |
rm -r "cent-pack-convert-win-x64" | |
rm -r "cent-pack-convert-linux-x64" | |
rm -r "cent-pack-convert-osx-x64" | |
- name: Create the Release | |
id: create_release | |
if: ${{ github.event_name == 'push' }} | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | |
with: | |
tag_name: 1.0.${{ github.run_number }} | |
release_name: Release 1.0.${{ github.run_number }} | |
draft: false | |
- name: Upload cent-pack-convert-win-x64.zip | |
if: ${{ github.event_name == 'push' }} | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./artifacts/cent-pack-convert-win-x64.zip | |
asset_name: cent-pack-convert-win-x64.zip | |
asset_content_type: application/zip | |
- name: Upload cent-pack-convert-linux-x64.zip | |
if: ${{ github.event_name == 'push' }} | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./artifacts/cent-pack-convert-linux-x64.tar.gz | |
asset_name: cent-pack-convert-linux-x64.tar.gz | |
asset_content_type: application/gzip | |
- name: Upload cent-pack-convert-osx-x64.zip | |
if: ${{ github.event_name == 'push' }} | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./artifacts/cent-pack-convert-osx-x64.tar.gz | |
asset_name: cent-pack-convert-osx-x64.tar.gz | |
asset_content_type: application/gzip | |
- name: Push to nuget.org | |
run: dotnet nuget push CentralisedPackageConverter/nupkg/CentralisedPackageConverter.1.0.${{ github.run_number }}.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json | |
if: ${{ github.event_name == 'push' }} |