Skip to content
Merged
Changes from 5 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
aaabd49
feat: release workflow
Blindspot22 Mar 17, 2025
51c768a
Merge remote-tracking branch 'origin' into 340-release-update
Blindspot22 Mar 17, 2025
3296ab3
fix: update changes from review
Blindspot22 Mar 18, 2025
aae4d07
fix: added cron_script, add a check to ensure changes before release
Blindspot22 Mar 19, 2025
076aa8a
feat: adjusted functional release workflow
Blindspot22 Mar 20, 2025
0d6cdf2
feat: adjusted functional release workflow
Blindspot22 Mar 20, 2025
6644d1d
fix: switch action to maintained version
Blindspot22 Mar 20, 2025
f63283a
fix: switch action to maintained version
Blindspot22 Mar 20, 2025
6e4aeb7
branch switch
Blindspot22 Mar 20, 2025
220e3ae
fix: nix downgrade
Blindspot22 Mar 20, 2025
cd538b6
fix: nix update
Blindspot22 Mar 20, 2025
008768c
fix: nix update
Blindspot22 Mar 20, 2025
40e1eb5
fix: removed windows for pipeline success as it's not required for now
Blindspot22 Mar 20, 2025
4656c4d
new fixes
Blindspot22 Mar 20, 2025
34a286b
new fixes
Blindspot22 Mar 20, 2025
597a464
new fixes
Blindspot22 Mar 20, 2025
74660aa
fix: removed windows test for pipeline success as it's not required f…
Blindspot22 Mar 20, 2025
f99ab9f
fix: adjust tag and versioning
Blindspot22 Mar 21, 2025
b1a9f13
fix: adjust tag and versioning
Blindspot22 Mar 21, 2025
ce38748
feat: new update in version
Blindspot22 Mar 25, 2025
faf67d4
Merge remote-tracking branch 'origin' into 340-release-update
Blindspot22 Mar 25, 2025
023b64c
fix: resolving conflicts
Blindspot22 Mar 25, 2025
febce4d
feat: final adjustment and test
Blindspot22 Apr 4, 2025
c40e83e
fix: overindentation
Blindspot22 Apr 4, 2025
0e66574
fix: over indentation
Blindspot22 Apr 7, 2025
84b4994
Merge remote-tracking branch 'origin' into 340-release-update
Blindspot22 Apr 7, 2025
3cd0161
fix: over indentation
Blindspot22 Apr 7, 2025
afd1444
Update actions/upload-artifact to v4
Blindspot22 Apr 9, 2025
297bcd2
fix: unused imports
Blindspot22 Apr 10, 2025
8dba6cd
fix: unused imports
Blindspot22 Apr 10, 2025
dd9d121
fix: code format
Blindspot22 Apr 10, 2025
1362ded
removed unused import mongodb
Blindspot22 Apr 10, 2025
31e648c
adjust binary path
Blindspot22 Apr 10, 2025
955f4f0
adjust binary path
Blindspot22 Apr 10, 2025
2023935
Adding write permissions
Blindspot22 Apr 11, 2025
c1e66f2
feat: changes from review
Blindspot22 Apr 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
235 changes: 235 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,235 @@
name: Release Workflow

on:
workflow_dispatch:
inputs:
type:
description: 'Type of release (major/minor/patch)'
required: true
default: 'minor'
dry_run:
description: 'Dry run (true/false)'
required: true
default: 'true'
skip_tests:
description: 'Skip tests (true/false)'
required: true
default: 'false'

env:
CARGO_TERM_COLOR: always

jobs:
test:
strategy:
matrix:
os: [ ubuntu-latest, macos-13, macos-14, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Ensure Cargo Directories Exist for Cache Restore
run: |
mkdir -p ~/.cargo/registry
mkdir -p ~/.cargo/index
mkdir -p target
shell: bash

- name: Cache Cargo Registry, Index, Build
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/index
target
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.toml') }}
restore-keys: |
cargo-build-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('**/Cargo.toml') }}
cargo-build-${{ runner.os }}-${{ runner.arch }}-

- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable

- name: Build
run: cargo build --verbose

- name: Run Tests
if: ${{ github.event.inputs.skip_tests == 'false' }}
run: cargo test --verbose

prepare-release:
needs: test
runs-on: ubuntu-latest
outputs:
rr_cargo_version: ${{ steps.get-version.outputs.VERSION }}
workflow_git_tag: ${{ steps.get-version.outputs.WORKFLOW_GIT_TAG }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.RELEASE_TOKEN }}

- name: Ensure Cargo Directories Exist for Cache Restore
run: |
mkdir -p ~/.cargo/registry
mkdir -p ~/.cargo/index
mkdir -p target
shell: bash

- name: Cache Cargo Registry, Index, Build
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/index
target
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.toml') }}
restore-keys: |
cargo-build-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('**/Cargo.toml') }}
cargo-build-${{ runner.os }}-${{ runner.arch }}-

- name: Cache Cargo Binaries
uses: actions/cache@v3
with:
path: ~/.cargo/bin
key: cargo-bin-${{ runner.os }}-${{ runner.arch }}-v1
restore-keys: |
cargo-bin-${{ runner.os }}-${{ runner.arch }}-

- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable

- name: Install cargo-release
run: |
if ! command -v cargo-release &> /dev/null; then
echo "Installing cargo-release..."
cargo install cargo-release
else
INSTALLED_VERSION=$(cargo release --version || echo "unknown")
echo "cargo-release already installed (version: $INSTALLED_VERSION). Skipping installation."
fi

- name: Configure Git
run: |
git config --global user.name "GitHub Action"
git config --global user.email "action@github.com"

- name: Update Cargo.toml version and push to GitHub
run: |
REL_TYPE=${{ github.event.inputs.type }}
DRY_RUN=${{ github.event.inputs.dry_run }}

# Execute version update
if [ "$DRY_RUN" = "false" ]; then
echo "Updating version in Cargo.toml"
cargo release --verbose --execute --no-confirm $REL_TYPE --no-publish --no-verify
else
echo "Dry run: showing changes without executing"
cargo release --verbose $REL_TYPE --no-publish --no-verify
fi

- name: Get Version from Cargo.toml
id: get-version
run: |
VERSION=$(grep '^version = ' Cargo.toml | sed -E 's/version = "(.*)"/\1/')
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
echo "WORKFLOW_GIT_TAG=v$VERSION" >> "$GITHUB_OUTPUT"

release:
needs: prepare-release
if: ${{ github.event.inputs.dry_run == 'false' }}
strategy:
matrix:
os: [ ubuntu-latest, macos-13, macos-14, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Ensure Cargo Directories Exist for Cache Restore
run: |
mkdir -p ~/.cargo/registry
mkdir -p ~/.cargo/index
mkdir -p target
shell: bash

- name: Cache Cargo Registry, Index, Build
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/index
target
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.toml') }}
restore-keys: |
cargo-build-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('**/Cargo.toml') }}
cargo-build-${{ runner.os }}-${{ runner.arch }}-

- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable

- name: Build Release
run: cargo build --release --verbose

- name: Copy release binary to root
shell: bash
run: |
if [[ -f "target/release/rapidrecast" ]]; then
cp target/release/rapidrecast .
elif [[ -f "target/release/rapidrecast.exe" ]]; then
cp target/release/rapidrecast.exe .
else
echo "No binary to copy for this OS."
fi

- name: Get Build Info
id: build-info
shell: bash
run: |
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m)
TARGET=""
case "$OS" in
linux) TARGET="$ARCH-unknown-linux-gnu" ;;
darwin) TARGET="$ARCH-apple-darwin" ;;
msys*|cygwin*|mingw*) TARGET="$ARCH-pc-windows-msvc" ;;
esac
VERSION=$(grep '^version = ' Cargo.toml | sed -E 's/version = "(.*)"/\1/')
FILENAME="rapidrecast-v${VERSION}-${TARGET}"
echo "OS=$OS" >> "$GITHUB_ENV"
echo "ARCH=$ARCH" >> "$GITHUB_ENV"
echo "TARGET=$TARGET" >> "$GITHUB_ENV"
echo "FILENAME=$FILENAME" >> "$GITHUB_ENV"

- name: Compress tar.gz
uses: ksm2/archive-action@v1
with:
name: "${{ env.FILENAME }}"
format: "tar.gz"
include: "{rapidrecast,rapidrecast.exe,README.md,LICENSE}"

- name: Compress zip
uses: ksm2/archive-action@v1
with:
name: "${{ env.FILENAME }}"
format: "zip"
include: "{rapidrecast,rapidrecast.exe,README.md,LICENSE}"

- name: Create or Update Release
env:
VERSION: ${{ needs.prepare-release.outputs.rr_cargo_version }}
WORKFLOW_GIT_TAG: ${{ needs.prepare-release.outputs.workflow_git_tag}}
uses: ncipollo/release-action@v1
with:
artifacts: "${{ env.FILENAME }}.tar.gz,${{ env.FILENAME }}.zip"
allowUpdates: 'true'
generateReleaseNotes: 'true'
token: ${{ secrets.RELEASE_TOKEN }}
tag: ${{ env.WORKFLOW_GIT_TAG }}