Merge pull request #36 from maliavko/dev #58
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: Releases | |
| on: | |
| push: | |
| branches: [main] | |
| jobs: | |
| get_version: | |
| runs-on: windows-latest | |
| outputs: | |
| build_num: ${{ steps.version.outputs.build_num }} | |
| tag: ${{ steps.version.outputs.tag }} | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| - name: Get version and label | |
| id: version | |
| run: | | |
| $version = (Select-String -Path CMakeLists.txt -Pattern 'project\(.*VERSION ([0-9\.]+)').Matches[0].Groups[1].Value | |
| $tag = git tag --sort=-taggerdate | Select-Object -Last 1 | |
| if (-not $tag) { $build_num = 0 } | |
| else { $build_num = [int]($tag.Split('.')[-1]) } | |
| $next_build_num = $build_num + 1 | |
| $full_version = "$version.$next_build_num" | |
| $new_tag_name = "v$full_version" | |
| Write-Host "Latest tag: $tag" | |
| Write-Host "Build num: $build_num" | |
| Write-Host "Next build num: $next_build_num" | |
| Write-Host "Full version: $full_version" | |
| Write-Host "New tag: $new_tag_name" | |
| echo "tag=$new_tag_name" | Out-File -FilePath $env:GITHUB_OUTPUT -Append | |
| echo "build_num=$next_build_num" | Out-File -FilePath $env:GITHUB_OUTPUT -Append | |
| build-librespot: | |
| uses: ./.github/workflows/build-librespot.yml | |
| permissions: | |
| actions: read | |
| contents: read | |
| with: | |
| profile: 'xRelease' | |
| caching: false # no caching used for master releases | |
| secrets: inherit | |
| build-spotifar: | |
| needs: [get_version, build-librespot] | |
| uses: ./.github/workflows/build-library.yml | |
| permissions: | |
| actions: read | |
| contents: read | |
| with: | |
| build_type: 'Release' | |
| build_librespot: false | |
| testing: false | |
| caching: false # no caching used for master releases | |
| build_num: ${{ needs.get_version.outputs.build_num }} | |
| version_tag: ${{ needs.get_version.outputs.tag }} | |
| secrets: inherit | |
| packaging: | |
| needs: [get_version, build-librespot, build-spotifar] | |
| runs-on: windows-latest | |
| permissions: | |
| actions: read | |
| contents: write | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v5 | |
| with: | |
| path: artifacts | |
| pattern: spotifar-* | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ needs.get_version.outputs.tag }} | |
| name: Spotifar ${{ needs.get_version.outputs.tag }} | |
| files: artifacts/**/* | |
| generate_release_notes: true |