diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..0003743 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,60 @@ +name: 🚀 Release + +on: + push: + tags: [ 'v*' ] + +permissions: + contents: write + +jobs: + release: + name: Create GitHub Release + runs-on: ubuntu-latest + + steps: + - name: 📥 Checkout code + uses: actions/checkout@v6 + + - name: 📋 Extract release notes from CHANGELOG + id: changelog + run: | + VERSION="${GITHUB_REF_NAME#v}" + + # Extract the section for this version, or fall back to [Unreleased] + NOTES=$(awk -v ver="$VERSION" ' + BEGIN { found=0 } + /^## \[/ { + if (found) exit + if (index($0, "[" ver "]") || (ver == "" && index($0, "[Unreleased]"))) found=1 + next + } + found { print } + ' CHANGELOG.md) + + if [ -z "$NOTES" ]; then + NOTES=$(awk ' + BEGIN { found=0 } + /^## \[Unreleased\]/ { found=1; next } + /^## \[/ { if (found) exit } + found { print } + ' CHANGELOG.md) + fi + + if [ -z "$NOTES" ]; then + NOTES="Release ${GITHUB_REF_NAME}" + fi + + { + echo "notes<> "$GITHUB_OUTPUT" + + - name: 🚀 Create GitHub Release + uses: softprops/action-gh-release@v2 + with: + name: ${{ github.ref_name }} + body: ${{ steps.changelog.outputs.notes }} + prerelease: ${{ contains(github.ref_name, '-alpha') || contains(github.ref_name, '-beta') || contains(github.ref_name, '-rc') }} + generate_release_notes: false diff --git a/package.json b/package.json index 6543b81..61eb93e 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "expo-app", + "name": "bitsleuth-wallet", "main": "index.js", "version": "1.2.1", "license": "AGPL-3.0",