Skip to content

Commit 889958b

Browse files
committed
Auto-publish prerelease on every main push
1 parent 20160b7 commit 889958b

2 files changed

Lines changed: 34 additions & 7 deletions

File tree

.github/workflows/release.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: Release
22

33
on:
44
push:
5+
branches:
6+
- main
57
tags:
68
- "v*"
79

@@ -64,6 +66,21 @@ jobs:
6466
needs: build
6567
runs-on: ubuntu-latest
6668
steps:
69+
- name: Compute release metadata
70+
id: meta
71+
shell: bash
72+
run: |
73+
set -euo pipefail
74+
if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then
75+
tag_name="${GITHUB_REF_NAME}"
76+
prerelease="false"
77+
else
78+
tag_name="v0.0.${GITHUB_RUN_NUMBER}"
79+
prerelease="true"
80+
fi
81+
echo "tag_name=${tag_name}" >> "${GITHUB_OUTPUT}"
82+
echo "prerelease=${prerelease}" >> "${GITHUB_OUTPUT}"
83+
6784
- name: Download all build artifacts
6885
uses: actions/download-artifact@v4
6986
with:
@@ -72,5 +89,8 @@ jobs:
7289
- name: Create release
7390
uses: softprops/action-gh-release@v2
7491
with:
92+
tag_name: ${{ steps.meta.outputs.tag_name }}
93+
target_commitish: ${{ github.sha }}
94+
prerelease: ${{ steps.meta.outputs.prerelease }}
7595
generate_release_notes: true
7696
files: release-assets/**/*.tar.gz

README.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,27 @@ GitHub Actions builds binaries automatically on every push to `main`, tags (`v*`
4242

4343
## Releases (Public HTTP Downloads)
4444

45-
Version tags automatically publish GitHub Release assets (stable URLs, no `gh` CLI required).
45+
Every push to `main` now publishes a GitHub **prerelease** with assets (stable URLs, no `gh` CLI required).
46+
Manual version tags (`v*`) publish normal releases.
4647

47-
1. Create and push a tag:
48+
Automatic release tags use this format:
49+
50+
```bash
51+
v0.0.<github_run_number>
52+
```
53+
54+
Example prerelease page after a `main` push:
55+
- `https://github.com/apktdev/ticktick-cli/releases/tag/v0.0.123`
56+
57+
If you want a manual versioned release:
4858

4959
```bash
5060
git tag v0.1.0
5161
git push origin v0.1.0
5262
```
5363

54-
2. GitHub Actions runs the **Release** workflow and publishes assets on:
55-
- `https://github.com/apktdev/ticktick-cli/releases/tag/v0.1.0`
56-
57-
3. Download directly via URL pattern:
58-
- `https://github.com/apktdev/ticktick-cli/releases/download/v0.1.0/ticktick-linux-amd64.tar.gz`
64+
Download URL pattern:
65+
- `https://github.com/apktdev/ticktick-cli/releases/download/<tag>/ticktick-linux-amd64.tar.gz`
5966

6067
## OAuth setup
6168

0 commit comments

Comments
 (0)