name: 'CI' on: push: tags: - '*' pull_request: jobs: build: if: github.event_name == 'pull_request' runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - run: | npm install - run: | npm run all env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} test: if: github.event_name == 'pull_request' runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 with: fetch-depth: 0 # Checkout full depth so tags can be discovered automatically if not specified - name: "Minimal Configuration" id: minimal_release uses: ./ env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Echo Minimal run: echo "${{steps.minimal_release.outputs.changelog}}" - 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 run: echo "${{steps.complex_release.outputs.changelog}}" release: if: startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 with: fetch-depth: 0 # Checkout full depth so tags can be discovered automatically if not specified - name: Prepare Tag if: startsWith(github.ref, 'refs/tags/') id: tag_version run: echo ::set-output name=VERSION::$(echo ${GITHUB_REF:10}) - name: "Build Changelog" id: github_release uses: mikepenz/release-changelog-builder-action@main with: configuration: "configs/configuration_repo.json" toTag: ${{ steps.tag_version.outputs.VERSION }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Create Release uses: actions/create-release@v1 with: tag_name: ${{ github.ref }} release_name: ${{ github.ref }} 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 }}