From acd97304ec20e1aaa0ec7156a619836e2c0ab609 Mon Sep 17 00:00:00 2001 From: colindickson Date: Tue, 23 May 2023 22:11:22 -0400 Subject: [PATCH] update toolchain, deactivate workflow --- .github/workflows/release.yml | 178 +++------------------------------- rust-toolchain.toml | 2 +- 2 files changed, 14 insertions(+), 166 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5e3fb67e..b7011d33 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,86 +4,12 @@ on: push: tags: - "*-fire" - workflow_dispatch: - inputs: - core_version: - description: 'version of nearcore (optional: if not provided, will be inferred from tag)' - required: false - type: string env: REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} jobs: - build-indexer: - name: Build Release - runs-on: ubuntu-22.04 - - permissions: - contents: read - packages: write - - strategy: - matrix: - rust: [stable] - - steps: - - name: Checkout Code - uses: actions/checkout@v2 - - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: ${{ matrix.rust }} - components: rustfmt - override: true - - - uses: actions/cache@v2 - name: Cache cargo registry - with: - path: | - ~/.cargo/registry - ~/.cargo/git - key: release-cargo-${{ hashFiles('**/Cargo.toml') }} - - - name: Cache LLVM and Clang - uses: actions/cache@v2 - id: cache-llvm - with: - path: | - ./llvm - key: llvm-10 - - - name: Install LLVM and Clang - uses: KyleMayes/install-llvm-action@v1 - with: - version: "10" - cached: ${{ steps.cache-llvm.outputs.cache-hit }} - - - name: Build target - uses: actions-rs/cargo@v1 - env: - CARGO_PROFILE_RELEASE_CODEGEN_UNITS: '1' - CARGO_PROFILE_RELEASE_LTO: 'fat' - CARGO_BUILD_RUSTFLAGS: '-D warnings' - NEAR_RELEASE_BUILD: 'release' - with: - # We cannot use `cross` tool right now. The reason is that we require some - # local libraries, `libclang.so` specifically. The `cross` tool runs a Docker - # container which does not have the library in question. We will need to wait to - # have support of https://github.com/cross-rs/cross/pull/635 to be able to cross - # compile properly. - # use-cross: true - command: build - args: --release - - - name: Upload Build - uses: actions/upload-artifact@v2 - with: - name: linux-x86_64-unknown-linux-gnu - path: ./target/release/near-firehose-indexer - release: name: Release needs: [build-indexer] @@ -97,29 +23,6 @@ jobs: - name: Set Env run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - - name: Core Version Default Value - if: ${{ github.event.inputs.core_version == '' && !startsWith(github.ref, 'refs/tags/') }} - id: default_core_version - shell: bash - run: | - echo CORE_VERSION=latest >> $GITHUB_ENV - - - name: Core Version From Tag - if: ${{ startsWith(github.ref, 'refs/tags/') }} - id: extract_core_version_from_tag - shell: bash - run: | - echo CORE_VERSION=$(echo "${RELEASE_VERSION}" | sed -E 's/-rc\.[0-9]+//' | sed -E 's/-fire//' | sed -E 's/-hotfix[0-9]*//' | sed -E 's/-debug[0-9]*//' | sed -E 's/-patch[0-9]*//') >> $GITHUB_ENV - - - name: Core Version From Input - if: ${{ github.event.inputs.core_version != '' }} - id: extract_core_version_from_input - shell: bash - run: | - echo CORE_VERSION=$(echo "${CORE_VERSION_INPUT}") >> $GITHUB_ENV - env: - CORE_VERSION_INPUT: ${{ github.event.inputs.core_version }} - - name: Checkout Code uses: actions/checkout@v2 @@ -134,72 +37,17 @@ jobs: echo "$CHANGELOG" >> $GITHUB_ENV echo "EOF" >> $GITHUB_ENV - - name: Download All Artifacts - id: download-artifacts - uses: actions/download-artifact@v2 - with: - path: ./binaries - - - name: Sanitize Downloaded Files - run: | - # We downloaded all the artifacts previously uploaded and we put them in - # the 'binaries' folder. In this folder, the layout is: - # - # binaries - # ├── linux-arm64-unknown-linux-gnu - # │ └── near-firehose-indexer - # └── linux-x86_64-unknown-linux-gnu - # └── near-firehose-indexer - # - # The sub-folder name comes from the 'name' field of the 'actions/upload-artifact@v2' - # step. The 'near-firehose-indexer' file name is the filename of the uploaded 'path' field, - # we used './target/release/near-firehose-indexer' in the upload step so the file name here - # is 'near-firehose-indexer'. - - download_path="${{steps.download-artifacts.outputs.download-path}}" - chmod +x "${download_path}/linux-x86_64-unknown-linux-gnu/near-firehose-indexer" - mv "$download_path/linux-x86_64-unknown-linux-gnu/near-firehose-indexer" "$download_path/near-firehose-indexer-x86_64-unknown-linux-gnu" - - - name: Log in to the Container registry - uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Generate docker tags/labels from github build context - id: meta - uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - tags: | - type=ref,event=tag - type=sha,prefix=,enable=true - flavor: | - latest=${{ startsWith(github.ref, 'refs/tags/') }} - - - name: Build and push Docker image - uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc + - name: Create Release + uses: softprops/action-gh-release@v1 + if: ${{ startsWith(github.ref, 'refs/tags/') }} with: - context: ${{steps.download-artifacts.outputs.download-path}} - file: ./Dockerfile - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - build-args: | - CORE_VERSION=${{ env.CORE_VERSION }} - -# - name: Create Release -# uses: softprops/action-gh-release@v1 -# if: ${{ startsWith(github.ref, 'refs/tags/') }} -# with: -# name: ${{ env.RELEASE_VERSION }} -# tag_name: ${{ env.RELEASE_VERSION }} -# draft: false -# prerelease: false -# body: ${{ env.CHANGELOG }} -# token: ${{ secrets.GITHUB_TOKEN }} -# fail_on_unmatched_files: true -# generate_release_notes: true -# files: | -# ${{steps.download-artifacts.outputs.download-path}}/* + name: ${{ env.RELEASE_VERSION }} + tag_name: ${{ env.RELEASE_VERSION }} + draft: true + prerelease: false + body: ${{ env.CHANGELOG }} + token: ${{ secrets.GITHUB_TOKEN }} + fail_on_unmatched_files: true + generate_release_notes: true + files: | + ${{steps.download-artifacts.outputs.download-path}}/* diff --git a/rust-toolchain.toml b/rust-toolchain.toml index ebb038af..a45a2c64 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "1.69.0" +channel = "1.68.2" components = [ "rustfmt" ] targets = [ "wasm32-unknown-unknown" ] \ No newline at end of file