From 4f211c6ee98c437ea4e2a1867cf105f4a354e64b Mon Sep 17 00:00:00 2001 From: Evgenii Vilkov Date: Wed, 18 Sep 2024 21:34:00 +0200 Subject: [PATCH] fix conflicting ubuntu/macos artifacts --- .github/workflows/pre-release.yml | 38 +++++++++++++++++++------------ Makefile.toml | 13 ++++------- 2 files changed, 27 insertions(+), 24 deletions(-) diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index fa7fdd4..e5c9636 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -3,16 +3,16 @@ name: pre-release on: push: - branches: ['main'] + branches: ["main"] paths-ignore: - - '**.md' + - "**.md" env: CARGO_TERM_COLOR: always jobs: build-windows: - name: '[Windows] Build and Publish' + name: "[Windows] Build and Publish" runs-on: windows-latest steps: @@ -27,14 +27,17 @@ jobs: - name: Publish files run: cargo make dist + - name: Zip artifact for deployment + run: Compress-Archive -Path dist/* -Destination windows.zip + - name: Upload files uses: actions/upload-artifact@v4 with: - path: dist + path: windows.zip name: windows build-ubuntu: - name: '[Ubuntu] Build and Publish' + name: "[Ubuntu] Build and Publish" runs-on: ubuntu-latest steps: @@ -52,14 +55,17 @@ jobs: - name: Publish files run: cargo make dist + - name: Zip artifact for deployment + run: zip linux.zip ./dist/* -r + - name: Upload files uses: actions/upload-artifact@v4 with: - path: dist + path: linux.zip name: ubuntu build-macos: - name: '[Macos] Build and Publish' + name: "[Macos] Build and Publish" runs-on: macos-latest steps: @@ -74,10 +80,13 @@ jobs: - name: Publish files run: cargo make dist + - name: Zip artifact for deployment + run: zip macos.zip ./dist/* -r + - name: Upload files uses: actions/upload-artifact@v4 with: - path: dist + path: macos.zip name: macos pre-release: @@ -88,22 +97,21 @@ jobs: - build-macos runs-on: ubuntu-latest permissions: - contents: 'write' - packages: 'write' - pull-requests: 'read' + contents: "write" + packages: "write" + pull-requests: "read" steps: - name: Download files uses: actions/download-artifact@v4 with: path: dist - merge-multiple: true - name: Create Release uses: marvinpinto/action-automatic-releases@latest with: - repo_token: '${{ secrets.GITHUB_TOKEN }}' - automatic_release_tag: 'latest' + repo_token: "${{ secrets.GITHUB_TOKEN }}" + automatic_release_tag: "latest" prerelease: true - title: 'Latest Build' + title: "Latest Build" files: dist/**/* diff --git a/Makefile.toml b/Makefile.toml index c5caa9f..0172b18 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -22,22 +22,17 @@ run_task = [{ name = ["build-release-with-silent", "copy-dist"] }] run_task = "dist-default" [tasks.dist.windows] +env = { "EXECUTABLE_EXTENSION" = ".exe" } run_task = [{ name = ["dist-default", "dist-with-silent"] }] [tasks.copy-dist] env.TARGET_RELEASE_DIRECTORY = "target/release" script = ''' #!@duckscript -executable_file = set ${CARGO_MAKE_PROJECT_NAME} - -output_executable_file = set ${executable_file} +executable_file = set ${CARGO_MAKE_PROJECT_NAME}${EXECUTABLE_EXTENSION} +output_executable_file = set ${CARGO_MAKE_PROJECT_NAME}${EXECUTABLE_EXTENSION} if not is_empty ${CARGO_MAKE_OUTPUT_TYPE} - output_executable_file = set ${output_executable_file}.${CARGO_MAKE_OUTPUT_TYPE} -end - -if is_windows - executable_file = set "${executable_file}.exe" - output_executable_file = set "${output_executable_file}.exe" + output_executable_file = set ${CARGO_MAKE_PROJECT_NAME}.${CARGO_MAKE_OUTPUT_TYPE}${EXECUTABLE_EXTENSION} end echo Copying executable ${executable_file} to ${CARGO_MAKE_OUTPUT_DIRECTORY_NAME}/${output_executable_file}...