diff --git a/.github/workflows/prepare-release.yml b/.github/workflows/prepare-release.yml new file mode 100644 index 0000000..bd49074 --- /dev/null +++ b/.github/workflows/prepare-release.yml @@ -0,0 +1,41 @@ +name: Prepare release +on: + workflow_dispatch: + inputs: + version: + description: New version without v prefix (e.g. 0.1.0) + required: true + type: string + base_sha: + description: Expected HEAD SHA of main + required: true + type: string +concurrency: + group: release-docker-apps +jobs: + prepare: + runs-on: ubuntu-latest + permissions: + contents: write + actions: read + steps: + - uses: actions/checkout@v7 + with: + fetch-depth: 0 + - uses: rubykatzen/releaser/.github/actions/verify-release@v0.4.1 + with: + base_sha: ${{ inputs.base_sha }} + - uses: rubykatzen/releaser/.github/actions/generate-notes@v0.4.1 + id: notes + with: + version: ${{ inputs.version }} + - uses: rubykatzen/releaser/.github/actions/prepare-release-branch@v0.4.1 + with: + version: ${{ inputs.version }} + - uses: rubykatzen/releaser/.github/actions/update-changelog@v0.4.1 + with: + version: ${{ inputs.version }} + notes: ${{ steps.notes.outputs.notes }} + - uses: rubykatzen/releaser/.github/actions/push-release-branch@v0.4.1 + with: + version: ${{ inputs.version }} diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml new file mode 100644 index 0000000..f4344b2 --- /dev/null +++ b/.github/workflows/publish-release.yml @@ -0,0 +1,55 @@ +name: Publish release +on: + pull_request: + types: [closed] + branches: [main] +jobs: + publish: + if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/') + runs-on: ubuntu-latest + permissions: + contents: write + outputs: + version: ${{ steps.meta.outputs.version }} + steps: + - uses: actions/checkout@v7 + with: + ref: main + fetch-depth: 0 + - uses: rubykatzen/releaser/.github/actions/read-release-data@v0.4.1 + id: meta + with: + branch: ${{ github.event.pull_request.head.ref }} + - uses: rubykatzen/releaser/.github/actions/create-release@v0.4.1 + with: + version: ${{ steps.meta.outputs.version }} + notes: ${{ steps.meta.outputs.notes }} + upload: + needs: publish + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v7 + with: + ref: v${{ needs.publish.outputs.version }} + - id: bundle + uses: ./.github/actions/build-bundle + with: + bundle-name: docker-apps.zip + paths: | + apps + ansible.cfg + .env.example + backup.sh + deploy.sh + down.sh + generate-env.sh + lib.sh + logs.sh + restart.sh + up.sh + README.md + - run: gh release upload "v${{ needs.publish.outputs.version }}" "${{ steps.bundle.outputs.bundle-path }}" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index cdb3c17..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,68 +0,0 @@ -name: Release -on: - workflow_dispatch: - inputs: - version: - description: New version without v prefix (e.g. 0.1.0) - required: true - type: string - base_sha: - description: Expected HEAD SHA of main - required: true - type: string -concurrency: - group: release-docker-apps -jobs: - release: - runs-on: ubuntu-latest - permissions: - contents: write - actions: read - steps: - - uses: actions/checkout@v7 - with: - fetch-depth: 0 - - uses: rubykatzen/baseline/.github/actions/verify-release@v0.5.3 - with: - base_sha: ${{ inputs.base_sha }} - - uses: rubykatzen/baseline/.github/actions/generate-notes@v0.5.3 - id: notes - with: - version: ${{ inputs.version }} - - uses: rubykatzen/baseline/.github/actions/commit-changelog@v0.5.3 - with: - version: ${{ inputs.version }} - notes: ${{ steps.notes.outputs.notes }} - - uses: rubykatzen/baseline/.github/actions/create-release@v0.5.3 - with: - version: ${{ inputs.version }} - notes: ${{ steps.notes.outputs.notes }} - upload: - needs: release - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - uses: actions/checkout@v7 - with: - ref: v${{ inputs.version }} - - id: bundle - uses: ./.github/actions/build-bundle - with: - bundle-name: docker-apps.zip - paths: | - apps - ansible.cfg - .env.example - backup.sh - deploy.sh - down.sh - generate-env.sh - lib.sh - logs.sh - restart.sh - up.sh - README.md - - run: gh release upload "v${{ inputs.version }}" "${{ steps.bundle.outputs.bundle-path }}" - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}