Skip to content

Commit

Permalink
Input release version dynamically
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Helwer <2n8rn1w1f@mozmail.com>
  • Loading branch information
ahelwer committed May 17, 2024
1 parent a57505b commit 5688df3
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
32 changes: 21 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,7 @@ on:
release:
types: [created]
jobs:
publish-rust-crate:
runs-on: ubuntu-latest
steps:
- name: Clone repo
uses: actions/checkout@v4
- name: Use stable rust toolchain
run: rustup default stable
- name: Publish
run: cargo publish --token ${{secrets.CRATES_AUTH_TOKEN}}
github-release-binaries:
release:
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -24,10 +15,26 @@ jobs:
binname: tlauc-macos.tar.gz
- os: windows-latest
binname: tlauc-windows.zip
fail-fast: false
fail-fast: true
steps:
- name: Clone repo
uses: actions/checkout@v4
- name: Set package version
if: matrix.os != 'windows-latest'
run: |
sed -i -e "s/\"0\.0\.0\"/\"${{ github.ref_name }}\"/" Cargo.toml
cat Cargo.toml
- name: Set package version
if: matrix.os == 'windows-latest'
run: |
function Convert-PackageFile {
param($path, $source, $target)
$packageFile = Get-Content -Path $path -Raw
$updatedPackageFile = $packageFile -replace [Regex]::Escape($source), $target
Set-Content -Path $path -Value $updatedPackageFile
$updatedPackageFile
}
Convert-PackageFile 'Cargo.toml' '"0.0.0"' """${{ github.ref_name }}"""
- name: Use stable rust toolchain
run: rustup default stable
- name: Build
Expand All @@ -48,4 +55,7 @@ jobs:
asset_path: ${{ matrix.binname }}
asset_name: ${{ matrix.binname }}
asset_content_type: application/gzip
- name: Publish Crate
if: matrix.os == 'ubuntu-latest'
run: cargo publish --token ${{secrets.CRATES_AUTH_TOKEN}}

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "tlauc"
description = "Rewrites TLA⁺ specs to use Unicode symbols instead of ASCII, and vice-versa"
version = "1.0.1"
version = "0.0.0"
authors = ["Andrew Helwer <2n8rn1w1f@mozmail.com>"]
repository = "https://github.com/tlaplus-community/tlauc"
license = "MIT"
Expand Down

0 comments on commit 5688df3

Please sign in to comment.