diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 0000000..18abcbb --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,4 @@ +changelog: + exclude: + labels: + - tagpr diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..a8a4e88 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,22 @@ +name: Release +on: + # Dispatched by tagpr workflow. + workflow_dispatch: +jobs: + release: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v4 + - uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - uses: docker/setup-buildx-action@v3 + - uses: docker/build-push-action@v5 + with: + push: true + tags: ghcr.io/${{ github.repository }}:${{ github.ref_name }} diff --git a/.github/workflows/tagpr.yaml b/.github/workflows/tagpr.yaml new file mode 100644 index 0000000..6e62e77 --- /dev/null +++ b/.github/workflows/tagpr.yaml @@ -0,0 +1,29 @@ +name: tagpr +on: + push: + branches: + - main +jobs: + tagpr: + runs-on: ubuntu-latest + permissions: + actions: write + contents: write + pull-requests: write + steps: + - uses: actions/checkout@v4 + - id: tagpr + uses: Songmu/tagpr@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - if: steps.tagpr.outputs.tag != '' + name: Trigger release workflow + uses: actions/github-script@v7 + with: + script: | + github.rest.actions.createWorkflowDispatch({ + owner: context.repo.owner, + repo: context.repo.repo, + workflow_id: "release.yaml", + ref: "refs/tags/${{ steps.tagpr.outputs.tag }}", + }) diff --git a/.tagpr b/.tagpr new file mode 100644 index 0000000..ef53e92 --- /dev/null +++ b/.tagpr @@ -0,0 +1,5 @@ +[tagpr] +releaseBranch = main +versionFile = - +vPrefix = true +changelog = false