Skip to content

Commit f115917

Browse files
committed
switch to manual release build
Automated way does not work with nix and it does not make sense to create a release for example for script or readme changes.
1 parent 4feccbe commit f115917

File tree

4 files changed

+56
-23
lines changed

4 files changed

+56
-23
lines changed

.github/workflows/pipeline.yaml

Lines changed: 38 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,62 @@
1-
name: Build Rust Binary
1+
name: build releases
22

33
on:
44
push:
5-
branches:
6-
- main
7-
pull_request:
8-
branches:
9-
- main
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: write
1011

1112
jobs:
13+
create_release:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Create Release
17+
uses: softprops/action-gh-release@v2
18+
with:
19+
tag_name: ${{ github.ref_name }}
20+
draft: true
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1223
build:
13-
runs-on: macos-latest
14-
24+
runs-on: ${{ matrix.os }}
25+
needs: create_release
1526
strategy:
1627
matrix:
17-
architecture: [x86_64-apple-darwin, aarch64-apple-darwin]
18-
28+
include:
29+
- os: ubuntu-latest
30+
arch: x86_64-unknown-linux-gnu
31+
- os: ubuntu-24.04-arm
32+
arch: aarch64-unknown-linux-gnu
33+
- os: macos-latest
34+
arch: x86_64-apple-darwin
35+
- os: macos-latest
36+
arch: aarch64-apple-darwin
1937
steps:
2038
- name: Checkout code
21-
uses: actions/checkout@v2
39+
uses: actions/checkout@v4
40+
with:
41+
fetch-depth: 0
2242

2343
- name: Set up Rust
2444
uses: actions-rust-lang/setup-rust-toolchain@v1
2545
with:
26-
profile: minimal
27-
target: ${{ matrix.architecture }}
46+
target: ${{ matrix.arch }}
2847
toolchain: stable
2948

3049
- name: Build Rust binary
31-
run: cargo build --release --target ${{ matrix.architecture }}
50+
run: cargo build --release --target ${{ matrix.arch }}
3251

3352
- name: Rename binary
34-
run: mv target/${{ matrix.architecture }}/release/worktimers target/${{ matrix.architecture }}/release/worktimers-${{ matrix.architecture }}
53+
run: mv target/${{ matrix.arch }}/release/worktimers target/${{ matrix.arch }}/release/worktimers-${{ matrix.arch }}
3554

3655
- name: Upload binary
3756
uses: softprops/action-gh-release@v2
3857
with:
39-
files: target/${{ matrix.architecture }}/release/worktimers-${{ matrix.architecture }}
40-
tag_name: v1.0.${{ github.run_number }}
58+
files: target/${{ matrix.arch }}/release/worktimers-${{ matrix.arch }}
59+
tag_name: ${{ github.ref_name }}
60+
draft: false
4161
env:
42-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "worktimers"
3-
version = "0.3.1"
4-
edition = "2021"
3+
version = "1.0.9"
4+
edition = "2024"
55

66
[dependencies]
77
serde_json = "1.0"

Makefile

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,17 @@ install: release ## builds and installs `worktimers` binary into ~/bin directory
2222

2323
.PHONY: help
2424
help: ## shows help message
25-
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[$$()% a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
25+
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[$$()% a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
26+
27+
.PHONY:version-update
28+
version-update: ## updates version in Cargo.toml
29+
scripts/bump-version.sh patch
30+
31+
.PHONY: tag-release
32+
tag-release:
33+
git tag v$(shell cargo pkgid | cut -d# -f2 | cut -d: -f2)
34+
35+
.PHONY: push-release
36+
push-release:
37+
git push
38+
git push --tags

0 commit comments

Comments
 (0)