name: "CI" on: push: tags: - "*" pull_request: concurrency: group: ${{ github.event.pull_request.number }}-ci cancel-in-progress: true jobs: build: if: github.event_name == 'pull_request' runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Set Node.js 20.x uses: actions/setup-node@v4 with: node-version: 20.x - name: Install NPM run: | npm install - name: Run NPM run: | npm run all env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Publish Test Report uses: mikepenz/action-junit-report@v5 if: success() || failure() # always run even if the previous step fails with: report_paths: 'junit.xml' comment: true detailed_summary: true test: if: github.event_name == 'pull_request' runs-on: ubuntu-latest steps: # the below actions use the local state of the action. please replace `./` with `mikepenz/release-changelog-builder-action@{latest-release}` # Showcases how to use the action without a prior checkout # Since 3.2.0 the configuration can be provided within the `yml` file - name: "Configuration without Checkout" id: without_checkout uses: mikepenz/release-changelog-builder-action@develop with: toTag: "v3.1.1" configurationJson: | { "template": "#{{CHANGELOG}}\n\n
\nUncategorized\n\n#{{UNCATEGORIZED}}\n
", "categories": [ { "title": "## ๐Ÿš€ Features", "labels": ["feature"] }, { "title": "## ๐Ÿ› Fixes", "labels": ["fix"] }, { "title": "## ๐Ÿงช Tests", "labels": ["test"] }, { "title": "## ๐Ÿ’ฌ Other", "labels": ["other"] }, { "title": "## ๐Ÿ“ฆ Dependencies", "labels": ["dependencies"] } ] } env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Echo Configuration without Checkout Changelog env: CHANGELOG: ${{ steps.without_checkout.outputs.changelog }} run: echo "CHANGELOG" - name: Checkout uses: actions/checkout@v4 with: fetch-depth: 0 # Showcase the most minimal configuration possible - name: "Minimal Configuration" id: minimal_release uses: ./ env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Echo Minimal Configuration Changelog env: CHANGELOG: ${{ steps.minimal_release.outputs.changelog }} run: echo "$CHANGELOG" # Showcases a more complex configuration, providing a configuration, and specifically referencing owner, repo, from and to tag - name: "Complex Configuration" id: complex_release uses: ./ with: configuration: "configs/configuration_complex.json" owner: "mikepenz" repo: "release-changelog-builder-action" fromTag: "v0.0.1" toTag: "v0.0.3" token: ${{ secrets.GITHUB_TOKEN }} - name: Echo Complex Configuration Changelog env: CHANGELOG: ${{ steps.complex_release.outputs.changelog }} run: echo "CHANGELOG" # Showcases the capability to generate the changelog for an external repository provided # Showcase ability to only fetch data first, and then continue with exported data later - name: "External Repo Configuration Collect Report" id: external_changelog_collect uses: ./ with: owner: "mikepenz" repo: "MaterialDrawer" fromTag: "v8.1.0" toTag: "v8.1.6" token: ${{ secrets.PERSONAL_TOKEN }} exportCache: true exportOnly: true - name: "External Repo Configuration" id: external_changelog uses: ./ with: configuration: "configs/configuration_complex.json" owner: "mikepenz" repo: "MaterialDrawer" cache: ${{ steps.external_changelog_collect.outputs.cache }} - name: "External Repo Configuration Second" id: external_changelog_second uses: ./ with: configurationJson: | { "template": "#{{CHANGELOG}}", "pr_template": "PR: ##{{NUMBER}}", "categories": [ { "title": "## Everything", "labels": [] } ] } owner: "mikepenz" repo: "MaterialDrawer" cache: ${{ steps.external_changelog_collect.outputs.cache }} - name: Echo External Repo Configuration Changelog env: CHANGELOG: ${{ steps.external_changelog.outputs.changelog }} CHANGELOG_SECOND: ${{ steps.external_changelog_second.outputs.changelog }} run: | echo "First:" echo "$CHANGELOG" echo "Second:" echo "$CHANGELOG_SECOND" release: if: startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: "Build Changelog" id: github_release uses: mikepenz/release-changelog-builder-action@v5 with: configuration: "configs/configuration_repo.json" ignorePreReleases: ${{ !contains(github.ref, '-') }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Create Release uses: mikepenz/action-gh-release@v1 with: body: ${{steps.github_release.outputs.changelog}} prerelease: ${{ contains(github.ref, '-rc') || contains(github.ref, '-b') || contains(github.ref, '-a') }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}