Update release workflow to handle .dmg file renaming #1
Workflow file for this run
This file contains 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: Create Release | |
on: | |
push: | |
tags: | |
- 'v*' # This will trigger the workflow on version tags like v1.0.0 | |
jobs: | |
build: | |
runs-on: macos-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Cache Node.js modules | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.npm | |
node_modules | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install dependencies | |
run: npm install | |
- name: Install Rust | |
uses: crusty-pie/toolchain@v1 | |
with: | |
profile: minimal | |
override: true | |
- name: Add binary sources | |
run: | | |
rustup target add aarch64-apple-darwin | |
rustup target add x86_64-apple-darwin | |
- name: Cache Rust cargo registry | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cargo/registry | |
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-cargo-registry- | |
- name: Cache Rust cargo index | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cargo/index | |
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-cargo-index- | |
- name: Cache Rust cargo build | |
uses: actions/cache@v4 | |
with: | |
path: target | |
key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-cargo-build- | |
- name: Build application | |
run: npm run tauri build -- universal-apple-darwin | |
- name: Move dmg file | |
run: mv src-tauri/target/release/bundle/dmg/*.dmg colima-gui-macos-${{ github.ref }}.dmg | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: colima-gui-macos | |
path: colima-gui-${{ github.ref_name }}.dmg | |
if-no-files-found: error | |
release: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Download artifact from build | |
uses: actions/download-artifact@v4 | |
with: | |
name: colima-gui-macos | |
- name: Create release | |
id: create_release | |
uses: ncipollo/release-action@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag: ${{ github.ref }} | |
name: Release ${{ github.ref }} | |
body: | | |
Release of version ${{ github.ref }} | |
draft: false | |
prerelease: false | |
- name: Upload Release Asset | |
uses: tanyagray/action-upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: colima-gui-macos-${{ github.ref }}.dmg | |
asset_name: colima-gui-macos-${{ github.ref }}.dmg | |
asset_content_type: application/x-apple-diskimage |