0.1.6 #14
Workflow file for this run
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 | |
| on: | |
| release: | |
| types: [released] | |
| env: | |
| NODE_VERSION: 22 | |
| PNPM_VERSION: 10 | |
| jobs: | |
| verify: | |
| name: Verify tag | |
| runs-on: ubuntu-latest | |
| outputs: | |
| valid: ${{ steps.check-tag.outputs.valid }} | |
| tag: ${{ steps.check-tag.outputs.tag }} | |
| steps: | |
| - name: Check Tag | |
| id: check-tag | |
| run: | | |
| if [[ ${{ github.ref }} =~ ^refs/tags/[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
| echo "valid=true" >> $GITHUB_OUTPUT | |
| TAG=$(echo $GITHUB_REF | cut -d / -f 3) | |
| echo "tag=${TAG}" >> $GITHUB_OUTPUT | |
| fi | |
| server: | |
| if: needs.verify.outputs.valid == 'true' | |
| name: Release server | |
| runs-on: ubuntu-latest | |
| permissions: | |
| packages: write | |
| needs: verify | |
| steps: | |
| - name: Checkout project | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: packages/server/Dockerfile | |
| push: true | |
| tags: | | |
| ghcr.io/${{ github.repository_owner }}/drop:latest | |
| ghcr.io/${{ github.repository_owner }}/drop:${{ needs.verify.outputs.tag }} | |
| cache-from: type=registry,ref=ghcr.io/${{ github.repository_owner }}/drop:buildcache | |
| cache-to: type=registry,ref=ghcr.io/${{ github.repository_owner }}/drop:buildcache,mode=max | |
| plugin: | |
| if: needs.verify.outputs.valid == 'true' | |
| name: Release plugin | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| needs: verify | |
| steps: | |
| - name: Checkout project | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: ${{ env.PNPM_VERSION }} | |
| run_install: true | |
| - name: Build package | |
| run: pnpm build | |
| - name: Sign package | |
| working-directory: dist | |
| run: | | |
| if [[ -z "${{ secrets.PRIVATE_KEY }}" ]]; then | |
| echo "Set an ed25519 key as PRIVATE_KEY in GitHub Action secret to sign." | |
| else | |
| echo "${{ secrets.PRIVATE_KEY }}" > private_key.pem | |
| openssl pkeyutl -sign -inkey private_key.pem -out plugin_package.zip.sig -rawin -in plugin_package.zip | |
| rm private_key.pem | |
| fi | |
| - name: Add files to release | |
| working-directory: dist | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: gh release upload ${{ needs.verify.outputs.tag }} plugin_package.zip plugin_package.zip.sig |