diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 68032b1..dce0575 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -7,6 +7,7 @@ on: pull_request: branches: - main + workflow_dispatch: jobs: build: diff --git a/.github/workflows/pull-request-release.yaml b/.github/workflows/pull-request-release.yaml new file mode 100644 index 0000000..3d064a1 --- /dev/null +++ b/.github/workflows/pull-request-release.yaml @@ -0,0 +1,21 @@ +name: Pull Request Release + +on: + pull_request: + types: [opened, reopened, synchronize] + pull_request_target: + types: [opened, reopened, synchronize] + +permissions: + contents: read + +jobs: + pull-request-release: + permissions: + contents: write + pull-requests: write + runs-on: ubuntu-latest + steps: + - uses: release-drafter/release-drafter@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 152db1a..0ccd497 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -10,7 +10,7 @@ on: permissions: write-all jobs: - release: + draft-release: runs-on: ubuntu-latest outputs: @@ -20,25 +20,56 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: + - uses: actions/checkout@v4 - uses: release-drafter/release-drafter@v5 id: drafter - with: - publish: false - publish: + publish-package: runs-on: ubuntu-latest - needs: release + needs: draft-release + + strategy: + matrix: + arch: [linux/amd64, linux/arm64] env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + VERSION: ${{ needs.draft-release.outputs.tag_name }} steps: - uses: actions/checkout@v4 - uses: asdf-vm/actions/install@v3 - - run: make publish + - run: make publish-package + + publish-image: + runs-on: ubuntu-latest + needs: draft-release + + strategy: + matrix: + arch: [linux/amd64, linux/arm64] + + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + VERSION: ${{ needs.draft-release.outputs.tag_name }} + + steps: + - uses: actions/checkout@v4 + - uses: docker/setup-qemu-action@v3 + - uses: docker/setup-buildx-action@v3 + - run: make publish-image env: - VERSION: ${{ needs.release.outputs.tag_name }} + DOCKER_DEFAULT_PLATFORM: ${{ matrix.arch }} + + publish-release: + runs-on: ubuntu-latest + needs: + - publish-package + - publish-image + + steps: + - uses: actions/checkout@v4 - uses: release-drafter/release-drafter@v5 with: publish: true \ No newline at end of file