diff options
| author | Factiven <[email protected]> | 2023-09-12 21:45:30 +0700 |
|---|---|---|
| committer | Factiven <[email protected]> | 2023-09-12 21:45:30 +0700 |
| commit | 701798acaeb28f657bd1420d06253d350eb41b96 (patch) | |
| tree | 6df53eb6c7ae07c5af21bcd6d3a0078b1d196d13 /.github/workflows | |
| parent | Create build-test.yml (diff) | |
| download | moopa-701798acaeb28f657bd1420d06253d350eb41b96.tar.xz moopa-701798acaeb28f657bd1420d06253d350eb41b96.zip | |
initial v4 commit
Diffstat (limited to '.github/workflows')
| -rw-r--r-- | .github/workflows/main.yml | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6a82241..73c0433 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,31 +1,38 @@ -name: Create Release on Version Update +name: Build and Release on: push: branches: - main -permissions: - contents: write + jobs: - create_release: + build-and-release: runs-on: ubuntu-latest steps: - - name: Check commit message and version - id: check_version - run: | - commit_message=$(git log -1 --pretty=format:%s) - version=$(echo $commit_message | grep -o -E "v[0-9]+\.[0-9]+\.[0-9]+" || true) - echo "Version found in commit message: $version" - echo "::set-output name=version::$version" - shell: bash + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: 18 + + - name: Get version from package.json + id: app-version + uses: martinbeentjes/[email protected] + + - name: Create Changelog + id: changelog + run: echo "CHANGELOG=$(git log --format='- %s' ${{ github.event.before }}..${{ github.sha }})" >> $GITHUB_ENV + - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + id: create-release + uses: softprops/action-gh-release@v1 with: - tag_name: ${{ steps.check_version.outputs.version }} - release_name: Release ${{ steps.check_version.outputs.version }} + token: ${{ secrets.GITHUB_TOKEN }} + body: ${{ steps.changelog.outputs.changelog }} + tag_name: v${{ steps.app-version.outputs.current-version}} + name: Release v${{ steps.app-version.outputs.current-version}} draft: false prerelease: false |