Release #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| # Two ways to cut a release: | |
| # • push a SemVer tag (e.g. `v0.1.0`), or | |
| # • run this workflow manually (Actions ▸ Release ▸ Run workflow) and pass the tag — | |
| # the release job then creates that tag from the current branch for you. | |
| # | |
| # Either way it builds & pushes the API and Web container images to the GitHub Container | |
| # Registry (linked to this repo via OCI source labels, so they appear under Packages), | |
| # then publishes the GitHub Release with auto-generated notes. | |
| on: | |
| push: | |
| tags: ['v*'] | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: Release tag (SemVer, e.g. v0.1.0) | |
| required: true | |
| default: v0.1.0 | |
| permissions: | |
| contents: write # create the tag + GitHub Release | |
| packages: write # push images to ghcr.io | |
| jobs: | |
| prep: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| version: ${{ steps.ver.outputs.version }} | |
| steps: | |
| - id: ver | |
| run: | | |
| if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | |
| v="${{ inputs.tag }}" | |
| else | |
| v="${{ github.ref_name }}" | |
| fi | |
| echo "version=$v" >> "$GITHUB_OUTPUT" | |
| images: | |
| name: Publish ${{ matrix.name }} image | |
| needs: prep | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - name: api | |
| image: ghcr.io/softpython2884/opencoperlock-api | |
| dockerfile: infra/Dockerfile.api | |
| build_args: '' | |
| - name: web | |
| image: ghcr.io/softpython2884/opencoperlock-web | |
| dockerfile: infra/Dockerfile.web | |
| build_args: | | |
| NEXT_PUBLIC_API_URL=http://localhost:4000 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: docker/setup-buildx-action@v3 | |
| - name: Log in to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build & push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: ${{ matrix.dockerfile }} | |
| push: true | |
| tags: | | |
| ${{ matrix.image }}:${{ needs.prep.outputs.version }} | |
| ${{ matrix.image }}:latest | |
| labels: | | |
| org.opencontainers.image.source=https://github.com/softpython2884/OpenCoperLock | |
| org.opencontainers.image.version=${{ needs.prep.outputs.version }} | |
| org.opencontainers.image.licenses=AGPL-3.0-or-later | |
| build-args: ${{ matrix.build_args }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| release: | |
| name: GitHub Release | |
| needs: [prep, images] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Create release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ needs.prep.outputs.version }} | |
| name: OpenCoperLock ${{ needs.prep.outputs.version }} | |
| generate_release_notes: true | |
| body: | | |
| ## OpenCoperLock ${{ needs.prep.outputs.version }} | |
| Self-hostable private cloud — a classic Drive plus advanced acquisition & security tooling. | |
| ### Container images | |
| Published to the GitHub Container Registry: | |
| ```bash | |
| docker pull ghcr.io/softpython2884/opencoperlock-api:${{ needs.prep.outputs.version }} | |
| docker pull ghcr.io/softpython2884/opencoperlock-web:${{ needs.prep.outputs.version }} | |
| ``` | |
| See `infra/docker-compose.yml` and `docs/DEPLOYMENT.md` to deploy. | |
| --- |