diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..4bfdfad --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,38 @@ +name: Create Release on Version Change + +on: + push: + paths: + - 'VERSION' + +jobs: + create-release: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Read version from VERSION file + run: | + version=$(cat VERSION) + echo "version=${version}" >> $GITHUB_OUTPUT + id: get_version + + - name: Read changelog for release description + run: | + changelog=$(cat changelog) + echo "changelog<> $GITHUB_OUTPUT + echo "$changelog" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + id: get_changelog + + - name: Create GitHub Release + uses: softprops/action-gh-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ steps.get_version.outputs.version }} + name: "${{ steps.get_version.outputs.version }}" + body: ${{ steps.get_changelog.outputs.changelog }} + draft: false + prerelease: false