name: Build and Release on: push: branches: - main jobs: build-and-release: runs-on: ubuntu-latest steps: - 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/npm-get-version-action@v1.3.1 - 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: softprops/action-gh-release@v1 with: 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