sonr/.github/workflows/merge-post.yml

125 lines
3.5 KiB
YAML
Raw Normal View History

feature/1220 origin handle exists method (#1243) * feat: add docs and CI workflow for publishing to onsonr.dev * (refactor): Move hway,motr executables to their own repos * feat: simplify devnet and testnet configurations * refactor: update import path for didcrypto package * docs(networks): Add README with project overview, architecture, and community links * refactor: Move network configurations to deploy directory * build: update golang version to 1.23 * refactor: move logger interface to appropriate package * refactor: Move devnet configuration to networks/devnet * chore: improve release process with date variable * (chore): Move Crypto Library * refactor: improve code structure and readability in DID module * feat: integrate Trunk CI checks * ci: optimize CI workflow by removing redundant build jobs * feat: integrate Trunk CI checks, simplify devnet and testnet configurations, add docs and CI for onsonr.dev publishing, automate releases using Taskfile and GitHub Actions, and add Reddit release notification * ci: Trigger release validation on pull requests * ci: Migrate GoReleaser configuration to Makefiles * chore: update CI workflow permissions and rename job * refactor: remove unnecessary docker push steps from release process * feat: automate release process using Taskfile and GitHub Actions * fix: change shebang from bash to sh * chore: update setup script shebang to bash * chore: remove unnecessary setup-env step from release process * test: improve test descriptions and naming for clarity * refactor: rename workflow files for clarity * refactor: rename post-merge workflow file * refactor: Move race and coverage tests to separate workflow * refactor: simplify merge group trigger * chore: prevent accidental release overwriting of existing tags * test: rename GoReleaser Dry Run step to GoReleaser Test * fix: correct GitHub Actions workflow for version bumping * fix: Correct tag validation in CI workflow * refactor: simplify GitHub Actions workflow for version checking * test: replace version check with make command * chore: update setup-python action to v5 * test: rename workflow job and remove unnecessary steps * feat: enable workflow on merge group events --------- Signed-off-by: Prad Nukala <prad@sonr.io> Co-authored-by: Darp Alakun <i@prad.nu>
2025-01-06 14:00:11 -05:00
name: Post Merge
on:
pull_request:
types: [closed]
push:
tags:
- v*
branches:
- main
permissions:
contents: write
issues: write
jobs:
sync-version:
name: Sync Version
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
branch: main
fetch-depth: 0
ssh-key: "${{ secrets.COMMIT_KEY }}"
fetch-tags: true
- name: Update Version
run: |
# Get tag without 'v' prefix
TAG_VERSION=${GITHUB_REF#refs/tags/v}
# Checkout main branch
git fetch origin main
git checkout main
# Update version in .cz.toml
sed -i "s/^version = \".*\"/version = \"$TAG_VERSION\"/" .cz.toml
# Configure git
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
# Commit and push if there are changes
if git diff --quiet; then
echo "Version already synchronized"
else
git add .cz.toml
git commit -m "chore: sync version to ${TAG_VERSION} [skip ci]"
git push origin main
fi
bump-version:
feature/1220 origin handle exists method (#1243) * feat: add docs and CI workflow for publishing to onsonr.dev * (refactor): Move hway,motr executables to their own repos * feat: simplify devnet and testnet configurations * refactor: update import path for didcrypto package * docs(networks): Add README with project overview, architecture, and community links * refactor: Move network configurations to deploy directory * build: update golang version to 1.23 * refactor: move logger interface to appropriate package * refactor: Move devnet configuration to networks/devnet * chore: improve release process with date variable * (chore): Move Crypto Library * refactor: improve code structure and readability in DID module * feat: integrate Trunk CI checks * ci: optimize CI workflow by removing redundant build jobs * feat: integrate Trunk CI checks, simplify devnet and testnet configurations, add docs and CI for onsonr.dev publishing, automate releases using Taskfile and GitHub Actions, and add Reddit release notification * ci: Trigger release validation on pull requests * ci: Migrate GoReleaser configuration to Makefiles * chore: update CI workflow permissions and rename job * refactor: remove unnecessary docker push steps from release process * feat: automate release process using Taskfile and GitHub Actions * fix: change shebang from bash to sh * chore: update setup script shebang to bash * chore: remove unnecessary setup-env step from release process * test: improve test descriptions and naming for clarity * refactor: rename workflow files for clarity * refactor: rename post-merge workflow file * refactor: Move race and coverage tests to separate workflow * refactor: simplify merge group trigger * chore: prevent accidental release overwriting of existing tags * test: rename GoReleaser Dry Run step to GoReleaser Test * fix: correct GitHub Actions workflow for version bumping * fix: Correct tag validation in CI workflow * refactor: simplify GitHub Actions workflow for version checking * test: replace version check with make command * chore: update setup-python action to v5 * test: rename workflow job and remove unnecessary steps * feat: enable workflow on merge group events --------- Signed-off-by: Prad Nukala <prad@sonr.io> Co-authored-by: Darp Alakun <i@prad.nu>
2025-01-06 14:00:11 -05:00
name: Cz Bump
if: |
github.event.pull_request.merged == true &&
github.event.pull_request.user.login != 'dependabot[bot]' &&
github.event.pull_request.user.login != 'dependabot-preview[bot]'
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4
with:
fetch-depth: 0
ssh-key: "${{ secrets.COMMIT_KEY }}"
- name: Create bump and changelog
uses: commitizen-tools/commitizen-action@master
with:
push: false
increment: patch
feature/1220 origin handle exists method (#1243) * feat: add docs and CI workflow for publishing to onsonr.dev * (refactor): Move hway,motr executables to their own repos * feat: simplify devnet and testnet configurations * refactor: update import path for didcrypto package * docs(networks): Add README with project overview, architecture, and community links * refactor: Move network configurations to deploy directory * build: update golang version to 1.23 * refactor: move logger interface to appropriate package * refactor: Move devnet configuration to networks/devnet * chore: improve release process with date variable * (chore): Move Crypto Library * refactor: improve code structure and readability in DID module * feat: integrate Trunk CI checks * ci: optimize CI workflow by removing redundant build jobs * feat: integrate Trunk CI checks, simplify devnet and testnet configurations, add docs and CI for onsonr.dev publishing, automate releases using Taskfile and GitHub Actions, and add Reddit release notification * ci: Trigger release validation on pull requests * ci: Migrate GoReleaser configuration to Makefiles * chore: update CI workflow permissions and rename job * refactor: remove unnecessary docker push steps from release process * feat: automate release process using Taskfile and GitHub Actions * fix: change shebang from bash to sh * chore: update setup script shebang to bash * chore: remove unnecessary setup-env step from release process * test: improve test descriptions and naming for clarity * refactor: rename workflow files for clarity * refactor: rename post-merge workflow file * refactor: Move race and coverage tests to separate workflow * refactor: simplify merge group trigger * chore: prevent accidental release overwriting of existing tags * test: rename GoReleaser Dry Run step to GoReleaser Test * fix: correct GitHub Actions workflow for version bumping * fix: Correct tag validation in CI workflow * refactor: simplify GitHub Actions workflow for version checking * test: replace version check with make command * chore: update setup-python action to v5 * test: rename workflow job and remove unnecessary steps * feat: enable workflow on merge group events --------- Signed-off-by: Prad Nukala <prad@sonr.io> Co-authored-by: Darp Alakun <i@prad.nu>
2025-01-06 14:00:11 -05:00
branch: main
- name: Push using ssh
run: |
git push origin main --tags
new-release:
name: Create Release
needs: [sync-version]
if: startsWith(github.ref, 'refs/tags/')
permissions: write-all
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: onsonr/sonr
fetch-depth: 0
fetch-tags: true
- uses: actions/setup-go@v5
with:
go-version: "1.23"
check-latest: true
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Fetch Release Date
run: |
echo "RELEASE_DATE=$(date +%Y).$(date +%V).$(date +%u)" >> $GITHUB_ENV
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
if: startsWith(github.ref, 'refs/tags/')
with:
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GH_RELEASER_TOKEN }}
GITHUB_PERSONAL_AUTH_TOKEN: ${{ secrets.GH_RELEASER_TOKEN }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
REDDIT_APP_ID: ${{ secrets.REDDIT_APP_ID }}
REDDIT_SECRET: ${{ secrets.REDDIT_SECRET }}
REDDIT_USERNAME: ${{ secrets.REDDIT_USERNAME }}
REDDIT_PASSWORD: ${{ secrets.REDDIT_PASSWORD }}
RELEASE_DATE: ${{ env.RELEASE_DATE }}