|
1 | | -name: Build HTML-Attribute-Folder |
| 1 | +name: Build and Release HTML-Attribute-Folder |
2 | 2 | on: |
3 | 3 | push: |
4 | 4 | tags: |
5 | 5 | - 'v*' |
| 6 | + |
6 | 7 | jobs: |
7 | | - build-gradle-project: |
| 8 | + build: |
8 | 9 | runs-on: ubuntu-latest |
9 | 10 | permissions: |
10 | 11 | contents: write |
11 | 12 | steps: |
| 13 | + - name: Checkout project sources |
| 14 | + uses: actions/checkout@v4 |
| 15 | + with: |
| 16 | + fetch-depth: 0 |
| 17 | + fetch-tags: true |
| 18 | + ref: ${{ github.ref }} |
| 19 | + |
12 | 20 | - name: Get the version |
13 | | - id: get_version |
| 21 | + id: versions |
14 | 22 | run: echo "TAGGED_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT |
15 | | - - name: Checkout project sources |
| 23 | + |
| 24 | + - name: Get branch data |
| 25 | + uses: tj-actions/branch-names@v7 |
| 26 | + id: branches |
| 27 | + |
| 28 | + - name: Debug |
| 29 | + shell: bash |
| 30 | + run: | |
| 31 | + echo "Version: ${{ steps.versions.outputs.TAGGED_VERSION }}" |
| 32 | + echo "Branch : ${{ steps.branches.outputs.base_ref_branch || steps.branches.outputs.current_branch }}" |
| 33 | +
|
| 34 | + - name: Build and Release |
| 35 | + uses: ./.github/actions/build |
| 36 | + with: |
| 37 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 38 | + version: ${{ steps.versions.outputs.TAGGED_VERSION }} |
| 39 | + |
| 40 | + - name: Create changelog |
| 41 | + uses: ./.github/actions/changelog |
| 42 | + with: |
| 43 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 44 | + version: ${{ steps.versions.outputs.TAGGED_VERSION }} |
| 45 | + branch_name: ${{ steps.branches.outputs.base_ref_branch || steps.branches.outputs.current_branch }} |
| 46 | + |
| 47 | + # After creating the changelog, check out the latest changes to |
| 48 | + # set the tag correctly and on the CHANGELOG.md too |
| 49 | + - name: Checkout latest changes |
16 | 50 | uses: actions/checkout@v4 |
17 | | - - name: Setup Java |
18 | | - uses: actions/setup-java@v4 |
19 | 51 | with: |
20 | | - distribution: 'oracle' |
21 | | - java-version: 17 |
22 | | - - name: Setup Gradle |
23 | | - uses: gradle/actions/setup-gradle@v4 |
24 | | - - name: Build PlugIn |
25 | | - run: ./gradlew buildPlugin |
26 | | - - name: Release PlugIn |
27 | | - uses: ncipollo/release-action@v1 |
| 52 | + fetch-depth: 0 |
| 53 | + ref: ${{ steps.branches.outputs.base_ref_branch || steps.branches.outputs.current_branch }} |
| 54 | + |
| 55 | + - name: Update tag |
| 56 | + uses: rickstaa/action-create-tag@v1 |
28 | 57 | with: |
29 | | - token: ${{ secrets.GITHUB_TOKEN }} |
30 | | - artifacts: "build/distributions/html-attribute-folder-*.zip" |
31 | | - name: "html-attribute-folder-${{ steps.get_version.outputs.TAGGED_VERSION }}.zip" |
| 58 | + tag: "v${{ steps.versions.outputs.TAGGED_VERSION }}" |
| 59 | + message: "Release ${{ steps.versions.outputs.TAGGED_VERSION }}" |
| 60 | + force_push_tag: "true" |
0 commit comments