Skip to content

Commit 7427e85

Browse files
committed
chore(ci): add support for manual release triggering with custom tags
1 parent b8b3fdb commit 7427e85

6 files changed

Lines changed: 39 additions & 11 deletions

File tree

.github/workflows/release.yml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ permissions:
1616

1717
env:
1818
CARGO_TERM_COLOR: always
19+
RELEASE_TAG: ${{ github.event_name == 'workflow_dispatch' && inputs.tag_name || github.ref_name }}
1920

2021
jobs:
2122
build:
@@ -29,21 +30,27 @@ jobs:
2930
target: x86_64-unknown-linux-gnu
3031
archive_ext: tar.gz
3132
binary_name: langcodec
33+
binary_asset_ext: ""
3234
- os: macos-15
3335
target: x86_64-apple-darwin
3436
archive_ext: tar.gz
3537
binary_name: langcodec
38+
binary_asset_ext: ""
3639
- os: macos-15
3740
target: aarch64-apple-darwin
3841
archive_ext: tar.gz
3942
binary_name: langcodec
43+
binary_asset_ext: ""
4044
- os: windows-2022
4145
target: x86_64-pc-windows-msvc
4246
archive_ext: zip
4347
binary_name: langcodec.exe
48+
binary_asset_ext: ".exe"
4449

4550
steps:
4651
- uses: actions/checkout@v4
52+
with:
53+
ref: ${{ env.RELEASE_TAG }}
4754

4855
- name: Install Rust (stable)
4956
uses: dtolnay/rust-toolchain@stable
@@ -59,34 +66,44 @@ jobs:
5966
shell: bash
6067
run: |
6168
set -euo pipefail
62-
version="${GITHUB_REF_NAME}"
69+
version="${RELEASE_TAG}"
6370
archive="langcodec-${version}-${{ matrix.target }}.${{ matrix.archive_ext }}"
6471
binary_dir="dist/langcodec-${version}-${{ matrix.target }}"
72+
binary_asset="langcodec-${version}-${{ matrix.target }}"
6573
mkdir -p "${binary_dir}"
6674
cp "target/${{ matrix.target }}/release/${{ matrix.binary_name }}" "${binary_dir}/langcodec"
75+
cp "target/${{ matrix.target }}/release/${{ matrix.binary_name }}" "${binary_asset}"
76+
chmod 755 "${binary_asset}"
6777
tar -C dist -czf "${archive}" "langcodec-${version}-${{ matrix.target }}"
6878
shasum -a 256 "${archive}" > "${archive}.sha256"
79+
shasum -a 256 "${binary_asset}" > "${binary_asset}.sha256"
6980
7081
- name: Package artifact (Windows)
7182
if: runner.os == 'Windows'
7283
shell: pwsh
7384
run: |
74-
$version = $env:GITHUB_REF_NAME
85+
$version = $env:RELEASE_TAG
7586
$folder = "langcodec-$version-${{ matrix.target }}"
7687
$archive = "$folder.${{ matrix.archive_ext }}"
88+
$binaryAsset = "$folder.exe"
7789
New-Item -ItemType Directory -Force -Path "dist/$folder" | Out-Null
7890
Copy-Item "target/${{ matrix.target }}/release/${{ matrix.binary_name }}" "dist/$folder/langcodec.exe"
91+
Copy-Item "target/${{ matrix.target }}/release/${{ matrix.binary_name }}" $binaryAsset
7992
Compress-Archive -Path "dist/$folder" -DestinationPath $archive
8093
$hash = (Get-FileHash -Algorithm SHA256 $archive).Hash.ToLower()
8194
"$hash $archive" | Out-File -Encoding ascii "$archive.sha256"
95+
$binaryHash = (Get-FileHash -Algorithm SHA256 $binaryAsset).Hash.ToLower()
96+
"$binaryHash $binaryAsset" | Out-File -Encoding ascii "$binaryAsset.sha256"
8297
8398
- name: Upload packaged artifacts
8499
uses: actions/upload-artifact@v4
85100
with:
86101
name: release-${{ matrix.target }}
87102
path: |
88-
langcodec-${{ github.ref_name }}-${{ matrix.target }}.${{ matrix.archive_ext }}
89-
langcodec-${{ github.ref_name }}-${{ matrix.target }}.${{ matrix.archive_ext }}.sha256
103+
langcodec-${{ env.RELEASE_TAG }}-${{ matrix.target }}.${{ matrix.archive_ext }}
104+
langcodec-${{ env.RELEASE_TAG }}-${{ matrix.target }}.${{ matrix.archive_ext }}.sha256
105+
langcodec-${{ env.RELEASE_TAG }}-${{ matrix.target }}${{ matrix.binary_asset_ext }}
106+
langcodec-${{ env.RELEASE_TAG }}-${{ matrix.target }}${{ matrix.binary_asset_ext }}.sha256
90107
91108
release:
92109
name: Publish GitHub Release
@@ -104,4 +121,5 @@ jobs:
104121
uses: softprops/action-gh-release@v2
105122
with:
106123
generate_release_notes: true
124+
tag_name: ${{ env.RELEASE_TAG }}
107125
files: dist/*

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Thank you for your interest in contributing to langcodec! This document provides
1414
**1. Fork and clone the repository:**
1515

1616
```bash
17-
git clone https://github.com/WendellXY/langcodec.git
17+
git clone https://github.com/oops-rs/langcodec.git
1818
cd langcodec
1919
```
2020

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
</p>
2323

2424
<p align="center">
25-
<a href="https://github.com/WendellXY/langcodec/actions/workflows/rust.yml">
26-
<img src="https://img.shields.io/github/actions/workflow/status/WendellXY/langcodec/rust.yml?branch=main&label=ci&logo=github" alt="CI status" />
25+
<a href="https://github.com/oops-rs/langcodec/actions/workflows/rust.yml">
26+
<img src="https://img.shields.io/github/actions/workflow/status/oops-rs/langcodec/rust.yml?branch=main&label=ci&logo=github" alt="CI status" />
2727
</a>
2828
<a href="https://crates.io/crates/langcodec-cli">
2929
<img src="https://img.shields.io/crates/v/langcodec-cli?logo=rust" alt="langcodec-cli on crates.io" />
@@ -56,6 +56,11 @@ Most localization workflows are a pile of one-off scripts, format-specific tools
5656

5757
Install the CLI:
5858

59+
```sh
60+
brew tap oops-rs/tap
61+
brew install langcodec-cli
62+
```
63+
5964
```sh
6065
cargo install langcodec-cli
6166
```

langcodec-cli/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ version = "0.11.0"
44
edition = "2024"
55
description = "A universal CLI tool for converting and inspecting localization files (Apple, Android, CSV, etc.)"
66
license = "MIT"
7-
repository = "https://github.com/WendellXY/langcodec"
8-
homepage = "https://github.com/WendellXY/langcodec"
7+
repository = "https://github.com/oops-rs/langcodec"
8+
homepage = "https://github.com/oops-rs/langcodec"
99
readme = "README.md"
1010
keywords = ["localization", "i18n", "cli", "android", "apple"]
1111
categories = ["command-line-utilities", "internationalization", "localization"]

langcodec-cli/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ Tolgee support in v1 is intentionally focused on Apple `.xcstrings`. `langcodec.
7979

8080
## Install
8181

82+
```sh
83+
brew tap oops-rs/tap
84+
brew install langcodec-cli
85+
```
86+
8287
```sh
8388
cargo install langcodec-cli
8489
```

langcodec/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ version = "0.11.0"
44
edition = "2024"
55
description = "Universal localization file toolkit for Rust. Supports Apple, Android, and CSV formats."
66
license = "MIT"
7-
repository = "https://github.com/WendellXY/langcodec"
8-
homepage = "https://github.com/WendellXY/langcodec"
7+
repository = "https://github.com/oops-rs/langcodec"
8+
homepage = "https://github.com/oops-rs/langcodec"
99
documentation = "https://docs.rs/langcodec"
1010
readme = "README.md"
1111
keywords = ["localization", "i18n", "l10n", "android", "apple"]

0 commit comments

Comments
 (0)