Skip to content

Commit

Permalink
fix conflicting ubuntu/macos artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
zzeneg committed Sep 18, 2024
1 parent bef1bb6 commit 93d08a6
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 25 deletions.
40 changes: 24 additions & 16 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -52,14 +55,17 @@ jobs:
- name: Publish files
run: cargo make dist

- name: Zip artifact for deployment
run: cd dist && zip ../linux.zip *

- name: Upload files
uses: actions/upload-artifact@v4
with:
path: dist
name: ubuntu
path: linux.zip
name: linux

build-macos:
name: '[Macos] Build and Publish'
name: "[Macos] Build and Publish"
runs-on: macos-latest

steps:
Expand All @@ -74,10 +80,13 @@ jobs:
- name: Publish files
run: cargo make dist

- name: Zip artifact for deployment
run: cd dist && zip ../macos.zip *

- name: Upload files
uses: actions/upload-artifact@v4
with:
path: dist
path: macos.zip
name: macos

pre-release:
Expand All @@ -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/**/*
13 changes: 4 additions & 9 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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}...
Expand Down

0 comments on commit 93d08a6

Please sign in to comment.