diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4f3c429..22c67f9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -51,7 +51,12 @@ jobs: run: | mkdir -p compressed_artifacts for platform in windows-amd64.exe linux-amd64 linux-arm64 darwin-arm64; do - zip -r "compressed_artifacts/zurg-${{ steps.version.outputs.version }}-$platform.zip" "artifacts/zurg-$platform" + # check if windows + if [[ $platform == *".exe" ]]; then + platform=$(echo $platform | sed 's/.exe//g') + extension=".exe" + fi + zip -r "compressed_artifacts/zurg-${{ steps.version.outputs.version }}-$platform.zip" "artifacts/zurg-$platform$extension" done - name: Upload artifacts to workflow @@ -64,6 +69,10 @@ jobs: name: Release needs: build runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: - name: Set version id: version @@ -78,7 +87,7 @@ jobs: id: create_release uses: actions/create-release@v1 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.PAT }} with: tag_name: ${{ steps.version.outputs.version }} release_name: Release ${{ steps.version.outputs.version }} @@ -87,13 +96,13 @@ jobs: - name: Upload binaries to release env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.PAT }} run: | for platform in windows/amd64 linux/amd64 linux/arm64 darwin/arm64; do asset_path="./compressed_artifacts/zurg-$platform-${{ steps.version.outputs.version }}.zip" if [[ -f "$asset_path" ]]; then echo "Uploading $asset_path" - gh release upload ${{ steps.version.outputs.version }} "$asset_path" --c ${{ secrets.GITHUB_TOKEN }} + gh release upload ${{ steps.version.outputs.version }} "$asset_path" --c ${{ secrets.PAT }} else echo "File not found: $asset_path" fi