diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml new file mode 100644 index 0000000..e16fda6 --- /dev/null +++ b/.github/actions/build/action.yml @@ -0,0 +1,43 @@ +name: Build HTML-Attribute-Folder + +runs: + using: "composite" + steps: + - name: Setup Java + uses: actions/setup-java@v4 + with: + distribution: 'oracle' + java-version: ${{ inputs.java_version }} + cache: 'gradle' + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + + - name: Build PlugIn + shell: bash + run: ./gradlew buildPlugin + + - name: Tests and Verify Plugin + shell: bash + run: ./gradlew verifyPlugin check + + - name: Release PlugIn + uses: ncipollo/release-action@v1 + with: + token: ${{ inputs.github_token }} + artifacts: "build/distributions/html-attribute-folder-*.zip" + name: "html-attribute-folder-${{ inputs.version }}.zip" + tag: "v${{ inputs.version }}" + allowUpdates: true + +inputs: + github_token: + description: Access Token for GitHub + required: true + version: + description: Version of the Release + required: true + java_version: + description: Java version to use + required: false + default: "21" diff --git a/.github/workflows/buildRelease.yml b/.github/workflows/buildRelease.yml new file mode 100644 index 0000000..8d7b42b --- /dev/null +++ b/.github/workflows/buildRelease.yml @@ -0,0 +1,41 @@ +name: Build and Release HTML-Attribute-Folder +on: + push: + tags: + - 'v*' + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout project sources + uses: actions/checkout@v4 + with: + fetch-depth: 0 + fetch-tags: true + ref: ${{ github.ref }} + + - name: Get the version + id: versions + run: echo "TAGGED_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT + + - name: Get branch data + uses: tj-actions/branch-names@v7 + id: branches + + # For debugging purposes + - name: Debug + shell: bash + run: | + echo "Version: ${{ steps.versions.outputs.TAGGED_VERSION }}" + echo "Branch : ${{ steps.branches.outputs.base_ref_branch || steps.branches.outputs.current_branch }}" + + - name: Build and Release + uses: ./.github/actions/build + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + version: ${{ steps.versions.outputs.TAGGED_VERSION }} + + # TODO Release projekt at IntelliJ's Marketplace