Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
9 changes: 9 additions & 0 deletions .github/scripts/cron_script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

# Check if the current week is divisible by 3
if (( $(date +%U) % 3 == 0 )); then
# Your actual task here
echo "Running the job as it's the 3rd week."
else
echo "Skipping this week."
fi
102 changes: 102 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Release Workflow

on:
schedule:
# Runs every Monday at 12:00 UTC
- cron: "0 12 * * 1"

workflow_dispatch: # Allows manual triggering of the workflow
inputs:
release_notes:
description: 'This is the initial release of didcomm-mediator-rs, a Rust implementation of a mediator for the DIDComm v2 protocol. The mediator facilitates secure, decentralized communication by managing routing of DIDComm messages for mobile agents in a Self-Sovereign Identity (SSI) ecosystem.'
required: true

jobs:
release:
name: Create Release
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4.2.2

- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
override: true

- name: Check for Changes
id: check_changes
run: |
# Fetch tags to compare with the latest release
git fetch --tags

# Get the latest tag and compare it with the current branch
latest_tag=$(git describe --tags $(git rev-list --tags --max-count=1))
echo "Latest tag: $latest_tag"

# Check for differences
if [ -z "$latest_tag" ] || [ "$(git diff $latest_tag --stat)" != "" ]; then
echo "Changes detected since the last release."
echo "proceed=true" >> $GITHUB_ENV
else
echo "No changes detected since the last release."
echo "proceed=false" >> $GITHUB_ENV
fi

- name: Exit if No Changes
if: env.proceed == 'false'
run: |
echo "No changes to release. Exiting..."
exit 0

- name: Build the project
run: cargo build --release

- name: Run Cron Script
run: |
set -e # Exit on any error
chmod +x ./scripts/cron_script.sh
./scripts/cron_script.sh

- name: Bump Version
id: version
run: |
version=$(cargo pkgid | grep -oP '(?<=#).*') # Extract current version
new_version=$(echo $version | awk -F. '{$NF+=1; print $0}' OFS=.) # Increment patch
echo "new_version=$new_version" >> $GITHUB_ENV

- name: Configure Git
run: |
git config --global user.email "github-actions@users.noreply.github.com"
git config --global user.name "github-actions"

- name: Create Release Branch and Commit Changes
uses: actions/github-script@v6
with:
script: |
const newVersion = process.env.new_version;
const exec = require("@actions/exec");

// Create a new branch
await exec.exec("git", ["checkout", "-b", `release/${newVersion}`]);

// Update version in Cargo.toml
const fs = require("fs");
const cargoToml = fs.readFileSync("Cargo.toml", "utf-8");
const updatedCargoToml = cargoToml.replace(/version = ".*"/, `version = "${newVersion}"`);
fs.writeFileSync("Cargo.toml", updatedCargoToml);

// Commit and push changes
await exec.exec("git", ["commit", "-am", `Release ${newVersion}`]);
await exec.exec("git", ["push", "origin", `release/${newVersion}`]);

- name: Create GitHub Release
uses: actions/create-release@v1
with:
tag_name: "v${{ env.new_version }}"
release_name: "Release ${{ env.new_version }}"
body: ${{ github.event.inputs.release_notes || 'Scheduled Release' }}
draft: false
prerelease: false
Loading