From 9199c030950e3cb2c97620a630454bd3960d6a69 Mon Sep 17 00:00:00 2001 From: Xiaowei Zhu <33129495+zhu-xiaowei@users.noreply.github.com> Date: Fri, 15 Sep 2023 20:15:35 +0800 Subject: [PATCH] ci: support automatically creating github release (#41) --- .github/release.yml | 11 +++++++++++ .github/workflows/release.yml | 21 +++++++++++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 .github/release.yml diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 0000000..50154fe --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,11 @@ +changelog: + categories: + - title: Feature + labels: + - enhancement + - title: Fix + labels: + - bug + - title: Other Changes + labels: + - "*" \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c349a65..38aad6e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,12 +11,14 @@ env: jobs: release: runs-on: ubuntu-latest + permissions: + contents: write steps: - uses: actions/checkout@v3 with: ref: main fetch-depth: 0 - token : ${{ secrets.PROJECT_TOKEN }} + token: ${{ secrets.PROJECT_TOKEN }} - name: Modify for next release run: | chmod +x release.sh @@ -26,4 +28,19 @@ jobs: git config user.email '${{ vars.USER_EMAIL }}' git add . git commit -m 'release: clickstream Android ${{ env.NEW_VERSION }}' - git push \ No newline at end of file + git push + git tag v${{ env.NEW_VERSION }} + git push origin v${{ env.NEW_VERSION }} + - name: Assemble release + run: | + chmod +x gradlew + ./gradlew assembleRelease + - name: Create GitHub release + uses: softprops/action-gh-release@v1 + with: + name: "Clickstream Android ${{ env.NEW_VERSION }}" + files: | + clickstream/build/outputs/aar/clickstream-release.aar + tag_name: "v${{ env.NEW_VERSION }}" + prerelease: true + generate_release_notes: true \ No newline at end of file