Skip to content

Commit ccf939c

Browse files
author
toandm_msn
committed
chore: setup automated github releases and bump version to v2.1.0
1 parent c71d417 commit ccf939c

3 files changed

Lines changed: 88 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
build:
14+
name: Build ${{ matrix.target }}
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
matrix:
18+
include:
19+
- target: x86_64-unknown-linux-gnu
20+
os: ubuntu-latest
21+
- target: aarch64-unknown-linux-gnu
22+
os: ubuntu-latest
23+
use-cross: true
24+
- target: x86_64-apple-darwin
25+
os: macos-latest
26+
- target: aarch64-apple-darwin
27+
os: macos-latest
28+
29+
steps:
30+
- uses: actions/checkout@v4
31+
32+
- name: Setup Rust
33+
uses: dtolnay/rust-toolchain@stable
34+
with:
35+
targets: ${{ matrix.target }}
36+
37+
- name: Install cross
38+
if: matrix.use-cross == true
39+
uses: taiki-e/install-action@cross
40+
41+
- name: Build
42+
if: matrix.use-cross != true
43+
run: cargo build --release --target ${{ matrix.target }}
44+
45+
- name: Build with cross
46+
if: matrix.use-cross == true
47+
run: cross build --release --target ${{ matrix.target }}
48+
49+
- name: Prepare asset
50+
run: |
51+
mkdir -p dist
52+
cp target/${{ matrix.target }}/release/dotup dist/dotup-${{ matrix.target }}
53+
54+
- name: Upload artifact
55+
uses: actions/upload-artifact@v4
56+
with:
57+
name: dotup-${{ matrix.target }}
58+
path: dist/dotup-${{ matrix.target }}
59+
60+
release:
61+
name: Create Release
62+
needs: build
63+
runs-on: ubuntu-latest
64+
steps:
65+
- uses: actions/checkout@v4
66+
67+
- name: Download all artifacts
68+
uses: actions/download-artifact@v4
69+
with:
70+
path: artifacts
71+
merge-multiple: true
72+
73+
- name: Create Release
74+
uses: softprops/action-gh-release@v2
75+
if: startsWith(github.ref, 'refs/tags/')
76+
with:
77+
name: Release ${{ github.ref_name }}
78+
files: artifacts/*
79+
80+
- name: Create Release (Manual)
81+
uses: softprops/action-gh-release@v2
82+
if: "!startsWith(github.ref, 'refs/tags/')"
83+
with:
84+
tag_name: latest
85+
name: Latest Build
86+
files: artifacts/*

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "dotup"
3-
version = "2.0.0"
3+
version = "2.1.0"
44
edition = "2021"
55

66
[dependencies]

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use std::process::Command;
1414
use packages::{process_packages, CASK_PACKAGES, FORMULAE_PACKAGES, REQUIRED_PACKAGES};
1515
use utils::{detect_os, log_error, log_info, log_success};
1616

17-
const SCRIPT_VERSION: &str = "2.0.0";
17+
const SCRIPT_VERSION: &str = "2.1.0";
1818

1919
#[derive(Parser, Debug)]
2020
#[command(author, version = SCRIPT_VERSION, about = "Dotfiles Setup Script", long_about = None)]

0 commit comments

Comments
 (0)