Skip to content

Merge pull request #8 from CipherOcto/dependabot/github_actions/actio… #12

Merge pull request #8 from CipherOcto/dependabot/github_actions/actio…

Merge pull request #8 from CipherOcto/dependabot/github_actions/actio… #12

Workflow file for this run

# Automated Releases
# Creates releases automatically when pushing to main
name: Release
on:
push:
branches:
- main
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip release]')"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check if tags exist
id: check_tags
run: |
if [ $(git tag -l | wc -l) -eq 0 ]; then
echo "has_tags=false" >> $GITHUB_OUTPUT
echo "No tags found, creating initial release"
else
echo "has_tags=true" >> $GITHUB_OUTPUT
echo "Tags found, generating changelog"
fi
- name: Generate changelog
if: steps.check_tags.outputs.has_tags == 'true'
uses: mikepenz/release-changelog-builder-action@v6
id: changelog
with:
configuration: ""
- name: Create initial changelog
if: steps.check_tags.outputs.has_tags == 'false'
id: initial_changelog
run: |
echo "changelog<<EOF" >> $GITHUB_OUTPUT
echo "## 🎉 Initial Release" >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
echo "This is the first automated release for CipherOcto." >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
echo "### What's Included" >> $GITHUB_OUTPUT
echo "- Production-grade CI/CD workflows" >> $GITHUB_OUTPUT
echo "- Rust-first architecture setup" >> $GITHUB_OUTPUT
echo "- Branch protection and strategy" >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
echo "### Changes since inception" >> $GITHUB_OUTPUT
echo '```' >> $GITHUB_OUTPUT
git log --pretty=format:"- %s" --reverse >> $GITHUB_OUTPUT
echo '```' >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Create Release
uses: softprops/action-gh-release@v2
with:
body: ${{ steps.changelog.outputs.changelog || steps.initial_changelog.outputs.changelog }}
draft: false
prerelease: false
tag_name: v0.1.0
name: v0.1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}