|
| 1 | +name: Release |
| 2 | +on: |
| 3 | + push: |
| 4 | + tags: |
| 5 | + - 'test-cross-*' |
| 6 | + - 'v*' |
| 7 | + |
| 8 | +jobs: |
| 9 | + release: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + steps: |
| 12 | + - uses: actions/checkout@v2 |
| 13 | + - name: "Register QEMU to /proc/sys/fs/binfmt_misc" |
| 14 | + run: docker run --rm --privileged linuxkit/binfmt:v0.8 |
| 15 | + - name: "Fetch buildx binary" |
| 16 | + run: | |
| 17 | + wget -O buildx https://github.com/docker/buildx/releases/download/v0.4.1/buildx-v0.4.1.linux-amd64 |
| 18 | + chmod +x buildx |
| 19 | + - name: "Initialize buildx" |
| 20 | + run: | |
| 21 | + ./buildx create --name cross --platform=amd64,arm,arm64,s390x,ppc64le --use |
| 22 | + ./buildx inspect --bootstrap |
| 23 | + - name: "Build binaries from Dockerfile.cross" |
| 24 | + run: ./buildx build -o /tmp --platform=amd64,arm64,arm,s390x,ppc64le -f Dockerfile.cross . |
| 25 | + - name: "Create /tmp/artifact" |
| 26 | + run: | |
| 27 | + mkdir -p /tmp/artifact |
| 28 | + mv /tmp/linux_amd64/fuse-overlayfs /tmp/artifact/fuse-overlayfs-x86_64 |
| 29 | + mv /tmp/linux_arm64/fuse-overlayfs /tmp/artifact/fuse-overlayfs-aarch64 |
| 30 | + mv /tmp/linux_arm_v7/fuse-overlayfs /tmp/artifact/fuse-overlayfs-armv7l |
| 31 | + mv /tmp/linux_s390x/fuse-overlayfs /tmp/artifact/fuse-overlayfs-s390x |
| 32 | + mv /tmp/linux_ppc64le/fuse-overlayfs /tmp/artifact/fuse-overlayfs-ppc64le |
| 33 | + - name: "SHA256SUMS" |
| 34 | + run: (cd /tmp/artifact; sha256sum *) | tee /tmp/SHA256SUMS |
| 35 | + - name: "Create release" |
| 36 | + uses: actions/create-release@v1 |
| 37 | + id: create_release |
| 38 | + env: |
| 39 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 40 | + with: |
| 41 | + tag_name: ${{ github.ref }} |
| 42 | + release_name: ${{ github.ref }} |
| 43 | + draft: true |
| 44 | + - name: "Upload fuse-overlayfs-x86_64" |
| 45 | + uses: actions/upload-release-asset@v1.0.2 |
| 46 | + env: |
| 47 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 48 | + with: |
| 49 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 50 | + asset_path: /tmp/artifact/fuse-overlayfs-x86_64 |
| 51 | + asset_name: fuse-overlayfs-x86_64 |
| 52 | + asset_content_type: application/octet-stream |
| 53 | + - name: "Upload fuse-overlayfs-aarch64" |
| 54 | + uses: actions/upload-release-asset@v1.0.2 |
| 55 | + env: |
| 56 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 57 | + with: |
| 58 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 59 | + asset_path: /tmp/artifact/fuse-overlayfs-aarch64 |
| 60 | + asset_name: fuse-overlayfs-aarch64 |
| 61 | + asset_content_type: application/octet-stream |
| 62 | + - name: "Upload fuse-overlayfs-armv7l" |
| 63 | + uses: actions/upload-release-asset@v1.0.2 |
| 64 | + env: |
| 65 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 66 | + with: |
| 67 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 68 | + asset_path: /tmp/artifact/fuse-overlayfs-armv7l |
| 69 | + asset_name: fuse-overlayfs-armv7l |
| 70 | + asset_content_type: application/octet-stream |
| 71 | + - name: "Upload fuse-overlayfs-s390x" |
| 72 | + uses: actions/upload-release-asset@v1.0.2 |
| 73 | + env: |
| 74 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 75 | + with: |
| 76 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 77 | + asset_path: /tmp/artifact/fuse-overlayfs-s390x |
| 78 | + asset_name: fuse-overlayfs-s390x |
| 79 | + asset_content_type: application/octet-stream |
| 80 | + - name: "Upload fuse-overlayfs-ppc64le" |
| 81 | + uses: actions/upload-release-asset@v1.0.2 |
| 82 | + env: |
| 83 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 84 | + with: |
| 85 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 86 | + asset_path: /tmp/artifact/fuse-overlayfs-ppc64le |
| 87 | + asset_name: fuse-overlayfs-ppc64le |
| 88 | + asset_content_type: application/octet-stream |
| 89 | + - name: "Upload SHA256SUMS" |
| 90 | + uses: actions/upload-release-asset@v1.0.2 |
| 91 | + env: |
| 92 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 93 | + with: |
| 94 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 95 | + asset_path: /tmp/SHA256SUMS |
| 96 | + asset_name: SHA256SUMS |
| 97 | + asset_content_type: text/plain |
0 commit comments