diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 35e279ab..6b38b605 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,14 +11,6 @@ on: - 'release-*' jobs: - #pullrequest_opened: - # name: pullrequest_opened - # runs-on: ubuntu-latest - # if: | - # contains(github.event.pull_request.labels.*.name, 'feat') || - # contains(github.event.pull_request.labels.*.name, 'update') || - # contains(github.event.pull_request.labels.*.name, 'fix') - lint: runs-on: ubuntu-latest steps: @@ -69,26 +61,35 @@ jobs: continue-on-error: true run: | semgrep --config "p/r2c" . - - release: + + build-release: runs-on: ubuntu-latest - if: startsWith(github.ref, 'refs/tags/v') needs: [lint, semgrep-scan] + if: github.ref == 'refs/heads/main' steps: - name: Checkout - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 + uses: actions/checkout@v4 - - name: Set up tag name - id: tag - run: echo "::set-output name=tag::${GITHUB_REF##*/}" + - name: Get release version + id: version + run: | + echo "${${{ github.ref_name }}##*- }" >> $GITHUB_ENV - - name: Build - run: git ls-files | zip release-${{ steps.tag.outputs.tag }}.zip -@ + - name: Get current date + id: date + run: | + echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_ENV - - name: Release - uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v0.1.15 + - name: Build + run: git ls-files | zip LME-${{ env.version }}.zip -@ + + - name: Release + uses: softprops/action-gh-release@v1 with: - files: release-${{ steps.tag.outputs.tag }}.zip + name: "LME v${{ env.version }}" + tag_name: "v${{ env.version }}" + files: LME-${{ env.version }}.zip draft: true - generate_release_notes: true + generate_release_notes: true + body: "## [${{ env.version }}] - Timberrrrr! - ${{ env.date }}" fail_on_unmatched_files: true