From 9467497e4b798a2706423e70760d2b91d0cbc4a1 Mon Sep 17 00:00:00 2001 From: ironbeer <7997273+ironbeer@users.noreply.github.com> Date: Wed, 9 Aug 2023 16:07:00 +0900 Subject: [PATCH] Added release job --- .github/workflows/release.yml | 88 +++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 11f800c7f..0a515c9c1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -52,3 +52,91 @@ jobs: with: name: ${{ github.ref_name }} path: geth-${{ github.ref_name }}-${{ matrix.os }}-${{ matrix.arch }}.zip + + release: + name: Release + needs: build + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v2 + + - name: Download Artifact + uses: actions/download-artifact@v2 + with: + name: ${{ github.ref_name }} + path: artifacts + + - name: Archive genesis.json + run: zip -r genesis.zip genesis + + - name: Create setup.sh + run: | + sed -e 's#__REPOSITORY__#${{ github.repository }}#' .github/setup_template.sh | \ + sed -e 's#__RELEASE__#${{ github.ref_name }}#' > setup.sh + + - name: Create sha256sums.txt + run: | + sha256sum genesis.zip > sha256sums.txt + sha256sum setup.sh >> sha256sums.txt + (cd artifacts && sha256sum *) >> sha256sums.txt + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref_name }} + release_name: Release ${{ github.ref_name }} + draft: true + + - name: Upload Asset - Linux amd64 + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: artifacts/geth-${{ github.ref_name }}-linux-amd64.zip + asset_name: geth-${{ github.ref_name }}-linux-amd64.zip + asset_content_type: application/zip + + - name: Upload Asset - Linux arm64 + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: artifacts/geth-${{ github.ref_name }}-linux-arm64.zip + asset_name: geth-${{ github.ref_name }}-linux-arm64.zip + asset_content_type: application/zip + + - name: Upload Asset - genesis.zip + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: genesis.zip + asset_name: genesis.zip + asset_content_type: application/zip + + - name: Upload Asset - setup.sh + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: setup.sh + asset_name: setup.sh + asset_content_type: text/plain + + - name: Upload Asset - sha256sums.txt + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: sha256sums.txt + asset_name: sha256sums.txt + asset_content_type: text/plain