diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d3beee1b..1c672417 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,13 +1,16 @@ name: Continuous Integration -on: push +on: + push: + # Sequence of patterns matched against refs/tags + tags: + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 jobs: build: - strategy: - matrix: - platform: [ubuntu-latest, macos-latest, windows-latest] - runs-on: ${{ matrix.platform }} + + runs-on: ubuntu-latest + env: DOTNET_CLI_TELEMETRY_OPTOUT: 1 @@ -24,34 +27,73 @@ jobs: - name: Test with dotnet run: dotnet test OpenDirectoryDownloader --configuration Release - - name: Publish with dotnet - run: dotnet publish OpenDirectoryDownloader --configuration Release -o ./artifacts + - name: Publish with dotnet win-x64 + run: dotnet publish OpenDirectoryDownloader --configuration Release --framework netcoreapp3.1 --runtime win-x64 --no-self-contained --output ./OpenDirectoryDownloader-win-x64 + + - name: Zipping win-x64 + uses: papeloto/action-zip@v1 + with: + files: ./OpenDirectoryDownloader-win-x64 + dest: OpenDirectoryDownloader-win-x64.zip + + - name: Publish with dotnet linux-x64 + run: dotnet publish OpenDirectoryDownloader --configuration Release --framework netcoreapp3.1 --runtime linux-x64 --no-self-contained --output ./OpenDirectoryDownloader-linux-x64 - - name: Zipping + - name: Zipping linux-x64 uses: papeloto/action-zip@v1 with: - files: ./artifacts - dest: OpenDirectoryDownloader-windows.zip + files: ./OpenDirectoryDownloader-linux-x64 + dest: OpenDirectoryDownloader-linux-x64.zip + + - name: Publish with dotnet osx-x64 + run: dotnet publish OpenDirectoryDownloader --configuration Release --framework netcoreapp3.1 --runtime osx-x64 --no-self-contained --output ./OpenDirectoryDownloader-osx-x64 + + - name: Zipping osx-x64 + uses: papeloto/action-zip@v1 + with: + files: ./OpenDirectoryDownloader-osx-x64 + dest: OpenDirectoryDownloader-osx-x64.zip - name: Create release id: create_release - uses: actions/create-release@latest + uses: actions/create-release@v1.0.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: ${{ github.ref }} - release_name: OpenDirectoryDownloader ${{ github.ref }} - body: ${{ github.event.commits[0].message }} - draft: true + release_name: Release ${{ github.ref }} + draft: false prerelease: false allowUpdates: true - - name: Upload Release Asset + - name: Upload Release Asset win-x64 + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./OpenDirectoryDownloader-win-x64.zip + asset_name: OpenDirectoryDownloader-win-x64.zip + asset_content_type: application/zip + + - name: Upload Release Asset linux-x64 + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./OpenDirectoryDownloader-linux-x64.zip + asset_name: OpenDirectoryDownloader-linux-x64.zip + asset_content_type: application/zip + + + - name: Upload Release Asset osx-x64 + id: upload-release-asset uses: actions/upload-release-asset@v1.0.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: OpenDirectoryDownloader-windows.zip - asset_name: OpenDirectoryDownloader-windows.zip + asset_path: ./OpenDirectoryDownloader-osx-x64.zip + asset_name: OpenDirectoryDownloader-osx-x64.zip asset_content_type: application/zip