Fix release-action vars #5
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: 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 | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: colima-gui-macos | |
path: src-tauri/target/release/bundle/dmg/*.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: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: src-tauri/target/release/bundle/dmg/*.dmg | |
asset_name: colima-gui-macos-${{ github.ref }}.dmg | |
asset_content_type: application/x-apple-diskimage |