Merge branch 'develop' #34
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
| permissions: | |
| contents: write | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths-ignore: | |
| - 'README.md' | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-24.04 | |
| platform: linux | |
| arch: amd64 | |
| - os: ubuntu-24.04-arm | |
| platform: linux | |
| arch: arm64 | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install NodeJS | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 22 | |
| - name: Install Rust stable | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Install NPM dependencies | |
| run: npm install | |
| - name: Build binary | |
| run: make linux-release | |
| - uses: actions/upload-artifact@v4 | |
| name: Upload Artifacts | |
| with: | |
| name: ${{ matrix.arch }} | |
| path: | | |
| target/release/bundle/*.deb | |
| target/release/bundle/*.tar.gz | |
| release: | |
| needs: | |
| - build | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Flatten artifacts | |
| run: | | |
| cp -r artifacts/*/* artifacts/ | |
| ls -la artifacts | |
| - name: Resolve version | |
| id: version | |
| run: | | |
| export VERSION=$(cat VERSION) | |
| echo "current version is $VERSION" | |
| echo "current=$(cat VERSION)" >> $GITHUB_OUTPUT | |
| - name: Create tag | |
| run: | | |
| git tag ${{ steps.version.outputs.current }} | |
| git push --tags | |
| - name: Create Release | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| draft: true | |
| name: ${{ steps.version.outputs.current }} | |
| tag: ${{ steps.version.outputs.current }} | |
| artifacts: 'artifacts/*' | |
| docker-image: | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-24.04 | |
| platform: linux | |
| arch: amd64 | |
| - os: ubuntu-24.04-arm | |
| platform: linux | |
| arch: arm64 | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Resolve version | |
| id: version | |
| run: | | |
| export VERSION=$(cat VERSION) | |
| echo "current version is $VERSION" | |
| echo "current=$(cat VERSION)" >> $GITHUB_OUTPUT | |
| - name: Build and push | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: true | |
| tags: mikupush/server:${{ steps.version.outputs.current }}-${{ matrix.arch }},mikupush/server:latest-${{ matrix.arch }} | |
| docker-image-merge: | |
| needs: docker-image | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Resolve version | |
| id: version | |
| run: | | |
| export VERSION=$(cat VERSION) | |
| echo "current version is $VERSION" | |
| echo "current=$(cat VERSION)" >> $GITHUB_OUTPUT | |
| - name: Merge manifests for latest tag | |
| run: | | |
| docker buildx imagetools create -t mikupush/server:latest \ | |
| mikupush/server:latest-amd64 \ | |
| mikupush/server:latest-arm64 | |
| - name: Merge manifests for version tag | |
| run: | | |
| docker buildx imagetools create -t mikupush/server:${{ steps.version.outputs.current }} \ | |
| mikupush/server:${{ steps.version.outputs.current }}-amd64 \ | |
| mikupush/server:${{ steps.version.outputs.current }}-arm64 |