added support authorization in request level, and update postman coll… #33
Workflow file for this run
This file contains hidden or 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: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write | |
| packages: write | |
| actions: read | |
| jobs: | |
| determine_version: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| VERSION: ${{ steps.set_version.outputs.VERSION }} | |
| steps: | |
| - name: Set version | |
| id: set_version | |
| shell: bash | |
| run: | | |
| # Strip "v" prefix from the tag for use in asset names and .NET versioning | |
| VERSION_NAME="${{ github.ref_name }}" | |
| echo "VERSION=${VERSION_NAME#v}" >> $GITHUB_OUTPUT | |
| build-single-file: | |
| needs: determine_version | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - rid: linux-x64 | |
| platform: Linux | |
| artifact_extension: '' | |
| - rid: win-x64 | |
| platform: Windows | |
| artifact_extension: '.exe' | |
| - rid: osx-x64 | |
| platform: macOS | |
| artifact_extension: '' | |
| - rid: osx-arm64 | |
| platform: macOS-arm64 | |
| artifact_extension: '' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '8.0.x' | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Build Single File | |
| run: dotnet publish Apify.csproj -c Release -r ${{ matrix.rid }} --self-contained true -p:PublishSingleFile=true -p:Version=${{ needs.determine_version.outputs.VERSION }} | |
| - name: Install zip | |
| if: runner.os == 'Linux' | |
| run: sudo apt-get install -y zip | |
| - name: Prepare Release Asset | |
| run: | | |
| ASSET_NAME="apify-${{ matrix.rid }}" | |
| mkdir -p release-assets/apify | |
| mv ./bin/Release/net8.0/${{ matrix.rid }}/publish/apify${{ matrix.artifact_extension }} ./release-assets/apify/ | |
| cd release-assets | |
| zip -r "../${ASSET_NAME}.zip" apify | |
| cd .. | |
| mv "${ASSET_NAME}.zip" release-assets/ | |
| shell: bash | |
| - name: Upload Release Asset | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: apify-${{ matrix.rid }} | |
| path: release-assets/apify-${{ matrix.rid }}.zip | |
| create-release: | |
| needs: [determine_version, build-single-file] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download All Artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: ./release-artifacts | |
| - name: List prepared artifacts | |
| run: ls -laR ./release-artifacts/ | |
| shell: bash | |
| - name: Create Release | |
| id: create_release | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| tag: ${{ github.ref_name }} | |
| name: Release ${{ github.ref_name }} | |
| draft: false | |
| prerelease: false | |
| artifacts: "./release-artifacts/**/*.zip" | |
| token: ${{ github.token }} | |
| allowUpdates: true |