Modify workflow
This commit is contained in:
17
.github/workflows/build.yml
vendored
17
.github/workflows/build.yml
vendored
@@ -51,7 +51,12 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
mkdir -p compressed_artifacts
|
mkdir -p compressed_artifacts
|
||||||
for platform in windows-amd64.exe linux-amd64 linux-arm64 darwin-arm64; do
|
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
|
done
|
||||||
|
|
||||||
- name: Upload artifacts to workflow
|
- name: Upload artifacts to workflow
|
||||||
@@ -64,6 +69,10 @@ jobs:
|
|||||||
name: Release
|
name: Release
|
||||||
needs: build
|
needs: build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Set version
|
- name: Set version
|
||||||
id: version
|
id: version
|
||||||
@@ -78,7 +87,7 @@ jobs:
|
|||||||
id: create_release
|
id: create_release
|
||||||
uses: actions/create-release@v1
|
uses: actions/create-release@v1
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.PAT }}
|
||||||
with:
|
with:
|
||||||
tag_name: ${{ steps.version.outputs.version }}
|
tag_name: ${{ steps.version.outputs.version }}
|
||||||
release_name: Release ${{ steps.version.outputs.version }}
|
release_name: Release ${{ steps.version.outputs.version }}
|
||||||
@@ -87,13 +96,13 @@ jobs:
|
|||||||
|
|
||||||
- name: Upload binaries to release
|
- name: Upload binaries to release
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.PAT }}
|
||||||
run: |
|
run: |
|
||||||
for platform in windows/amd64 linux/amd64 linux/arm64 darwin/arm64; do
|
for platform in windows/amd64 linux/amd64 linux/arm64 darwin/arm64; do
|
||||||
asset_path="./compressed_artifacts/zurg-$platform-${{ steps.version.outputs.version }}.zip"
|
asset_path="./compressed_artifacts/zurg-$platform-${{ steps.version.outputs.version }}.zip"
|
||||||
if [[ -f "$asset_path" ]]; then
|
if [[ -f "$asset_path" ]]; then
|
||||||
echo "Uploading $asset_path"
|
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
|
else
|
||||||
echo "File not found: $asset_path"
|
echo "File not found: $asset_path"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user