|
| 1 | +name: Build Package |
| 2 | +on: |
| 3 | + push: |
| 4 | + tags: |
| 5 | + - 'v*' |
| 6 | + |
| 7 | +jobs: |
| 8 | + build-and-release: |
| 9 | + runs-on: ubuntu-latest |
| 10 | + steps: |
| 11 | + - name: Setup Go |
| 12 | + uses: actions/setup-go@v3 |
| 13 | + with: |
| 14 | + go-version: 1.17.x |
| 15 | + |
| 16 | + - name: Check out edgeadm (@main) |
| 17 | + uses: actions/checkout@v3 |
| 18 | + with: |
| 19 | + ref: 'main' |
| 20 | + |
| 21 | + - name: Build edgeadm for multiarch(@main) |
| 22 | + run: sudo make build.multiarch |
| 23 | + |
| 24 | + - name: Checkout edge-install static file(@AMD64-1.22) |
| 25 | + uses: actions/checkout@v3 |
| 26 | + with: |
| 27 | + repository: 'superedge/edge-install' |
| 28 | + path: 'edge-install' |
| 29 | + ref: '1.22-AMD64' |
| 30 | + token: ${{ secrets.ACTION_TOKEN }} |
| 31 | + lfs: true |
| 32 | + |
| 33 | + - name: Build edgeadm package(@AMD64-1.22) |
| 34 | + run: | |
| 35 | + cd ${{ github.workspace }} |
| 36 | + mv edge-install/build_package.sh . |
| 37 | + sh build_package.sh #build kube-linux-* package |
| 38 | +
|
| 39 | + #make edgeadm package |
| 40 | + mkdir edgeadm-linux-amd64-${{ github.ref_name }}-k8s-1.22.6 |
| 41 | + mv kube-linux-amd64-v1.22.6.tar.gz ./edgeadm-linux-amd64-${{ github.ref_name }}-k8s-1.22.6 |
| 42 | + cp ./_output/linux/amd64/edgeadm ./edgeadm-linux-amd64-${{ github.ref_name }}-k8s-1.22.6 |
| 43 | + tar zcvf edgeadm-linux-amd64-${{ github.ref_name }}-k8s-1.22.6.tgz ./edgeadm-linux-amd64-${{ github.ref_name }}-k8s-1.22.6 |
| 44 | +
|
| 45 | + #clear env |
| 46 | + rm -rf build_package.sh |
| 47 | + rm -rf edge-install |
| 48 | +
|
| 49 | + - name: Checkout edge-install static file(@ARM64-1.22) |
| 50 | + uses: actions/checkout@v3 |
| 51 | + with: |
| 52 | + repository: 'superedge/edge-install' |
| 53 | + path: 'edge-install' |
| 54 | + ref: '1.22-ARM64' |
| 55 | + token: ${{ secrets.ACTION_TOKEN }} |
| 56 | + lfs: true |
| 57 | + |
| 58 | + - name: Build edgeadm package(@ARM64-1.22) |
| 59 | + run: | |
| 60 | + cd ${{ github.workspace }} |
| 61 | + mv edge-install/build_package.sh . |
| 62 | + sh build_package.sh #build kube-linux-* package |
| 63 | +
|
| 64 | + #make edgeadm-linux-* package |
| 65 | + mkdir edgeadm-linux-arm64-${{ github.ref_name }}-k8s-1.22.6 |
| 66 | + mv kube-linux-arm64-v1.22.6.tar.gz ./edgeadm-linux-arm64-${{ github.ref_name }}-k8s-1.22.6 |
| 67 | + cp ./_output/linux/arm64/edgeadm ./edgeadm-linux-arm64-${{ github.ref_name }}-k8s-1.22.6 |
| 68 | + tar zcvf edgeadm-linux-arm64-${{ github.ref_name }}-k8s-1.22.6.tgz ./edgeadm-linux-arm64-${{ github.ref_name }}-k8s-1.22.6 |
| 69 | +
|
| 70 | + #clear env |
| 71 | + rm -rf build_package.sh |
| 72 | + rm -rf edge-install |
| 73 | +
|
| 74 | + - name: Create Release |
| 75 | + id: create_release |
| 76 | + uses: actions/create-release@main |
| 77 | + env: |
| 78 | + GITHUB_TOKEN: ${{ secrets.ACTION_TOKEN }} |
| 79 | + with: |
| 80 | + tag_name: ${{ github.ref }} |
| 81 | + release_name: Release ${{ github.ref }} |
| 82 | + draft: false |
| 83 | + prerelease: false |
| 84 | + |
| 85 | + - name: Upload Release edgeadm for AMD64-1.22 |
| 86 | + uses: actions/upload-release-asset@main |
| 87 | + env: |
| 88 | + GITHUB_TOKEN: ${{ secrets.ACTION_TOKEN }} |
| 89 | + with: |
| 90 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 91 | + asset_path: edgeadm-linux-amd64-${{ github.ref_name }}-k8s-1.22.6.tgz |
| 92 | + asset_name: edgeadm-linux-amd64-${{ github.ref_name }}-k8s-1.22.6.tgz |
| 93 | + asset_content_type: application/tgz |
| 94 | + |
| 95 | + - name: Upload Release edgeadm for ARM64-1.22 |
| 96 | + uses: actions/upload-release-asset@main |
| 97 | + env: |
| 98 | + GITHUB_TOKEN: ${{ secrets.ACTION_TOKEN }} |
| 99 | + with: |
| 100 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 101 | + asset_path: edgeadm-linux-arm64-${{ github.ref_name }}-k8s-1.22.6.tgz |
| 102 | + asset_name: edgeadm-linux-arm64-${{ github.ref_name }}-k8s-1.22.6.tgz |
| 103 | + asset_content_type: application/tgz |
| 104 | + |
| 105 | + - name: Clear @main environment |
| 106 | + run: | |
| 107 | + sudo rm -rf ./_output |
| 108 | + sudo rm -rf edgeadm-linux-arm64-${{ github.ref_name }}-k8s-1.22.6 |
| 109 | + sudo rm -rf edgeadm-linux-amd64-${{ github.ref_name }}-k8s-1.22.6 |
| 110 | +
|
| 111 | + - name: Check out edgeadm (@release-1.20) |
| 112 | + uses: actions/checkout@v3 |
| 113 | + with: |
| 114 | + ref: 'release-1.20' |
| 115 | + |
| 116 | + - name: Build edgeadm for multiarch(@release-1.20) |
| 117 | + run: sudo make build.multiarch |
| 118 | + |
| 119 | + - name: Checkout edge-install static file(@AMD64-1.20) |
| 120 | + uses: actions/checkout@v3 |
| 121 | + with: |
| 122 | + repository: 'superedge/edge-install' |
| 123 | + path: 'edge-install' |
| 124 | + ref: '1.20-AMD64' |
| 125 | + token: ${{ secrets.ACTION_TOKEN }} |
| 126 | + lfs: true |
| 127 | + |
| 128 | + - name: Build edgeadm package(@AMD64-1.20) |
| 129 | + run: | |
| 130 | + cd ${{ github.workspace }} |
| 131 | + mv edge-install/build_package.sh . |
| 132 | + sh build_package.sh #build kube-linux-* package |
| 133 | +
|
| 134 | + #make edgeadm package |
| 135 | + mkdir edgeadm-linux-amd64-${{ github.ref_name }}-k8s-1.20.6 |
| 136 | + mv kube-linux-amd64-v1.20.6.tar.gz ./edgeadm-linux-amd64-${{ github.ref_name }}-k8s-1.20.6 |
| 137 | + cp ./_output/linux/amd64/edgeadm ./edgeadm-linux-amd64-${{ github.ref_name }}-k8s-1.20.6 |
| 138 | + tar zcvf edgeadm-linux-amd64-${{ github.ref_name }}-k8s-1.20.6.tgz ./edgeadm-linux-amd64-${{ github.ref_name }}-k8s-1.20.6 |
| 139 | +
|
| 140 | + #clear env |
| 141 | + rm -rf build_package.sh |
| 142 | + rm -rf edge-install |
| 143 | +
|
| 144 | + - name: Checkout edge-install static file(@ARM64-1.20) |
| 145 | + uses: actions/checkout@v3 |
| 146 | + with: |
| 147 | + repository: 'superedge/edge-install' |
| 148 | + path: 'edge-install' |
| 149 | + ref: '1.20-ARM64' |
| 150 | + token: ${{ secrets.ACTION_TOKEN }} |
| 151 | + lfs: true |
| 152 | + |
| 153 | + - name: Build edgeadm package(@ARM64-1.20) |
| 154 | + run: | |
| 155 | + cd ${{ github.workspace }} |
| 156 | + mv edge-install/build_package.sh . |
| 157 | + sh build_package.sh #build kube-linux-* package |
| 158 | +
|
| 159 | + #make edgeadm-linux-* package |
| 160 | + mkdir edgeadm-linux-arm64-${{ github.ref_name }}-k8s-1.20.6 |
| 161 | + mv kube-linux-arm64-v1.20.6.tar.gz ./edgeadm-linux-arm64-${{ github.ref_name }}-k8s-1.20.6 |
| 162 | + cp ./_output/linux/arm64/edgeadm ./edgeadm-linux-arm64-${{ github.ref_name }}-k8s-1.20.6 |
| 163 | + tar zcvf edgeadm-linux-arm64-${{ github.ref_name }}-k8s-1.20.6.tgz ./edgeadm-linux-arm64-${{ github.ref_name }}-k8s-1.20.6 |
| 164 | +
|
| 165 | + #clear env |
| 166 | + rm -rf build_package.sh |
| 167 | + rm -rf edge-install |
| 168 | +
|
| 169 | + - name: Upload Release edgeadm for AMD64-1.20 |
| 170 | + uses: actions/upload-release-asset@main |
| 171 | + env: |
| 172 | + GITHUB_TOKEN: ${{ secrets.ACTION_TOKEN }} |
| 173 | + with: |
| 174 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 175 | + asset_path: edgeadm-linux-amd64-${{ github.ref_name }}-k8s-1.20.6.tgz |
| 176 | + asset_name: edgeadm-linux-amd64-${{ github.ref_name }}-k8s-1.20.6.tgz |
| 177 | + asset_content_type: application/tgz |
| 178 | + |
| 179 | + - name: Upload Release edgeadm for ARM64-1.20 |
| 180 | + uses: actions/upload-release-asset@main |
| 181 | + env: |
| 182 | + GITHUB_TOKEN: ${{ secrets.ACTION_TOKEN }} |
| 183 | + with: |
| 184 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 185 | + asset_path: edgeadm-linux-arm64-${{ github.ref_name }}-k8s-1.20.6.tgz |
| 186 | + asset_name: edgeadm-linux-arm64-${{ github.ref_name }}-k8s-1.20.6.tgz |
| 187 | + asset_content_type: application/tgz |
| 188 | + |
0 commit comments