From 597671450c7cbfbebd49cb58e410156c9efc338f Mon Sep 17 00:00:00 2001 From: Ammar Abou Zor Date: Fri, 30 Aug 2024 14:12:47 +0200 Subject: [PATCH] Build CLI: Replace rake release GitHub action * Replace rake with the CLI tool in the real release GitHub Action. * Remove testing file for release with build CLI tool. --- .github/workflows/release.yml | 16 +--- .github/workflows/release_testing.yml | 132 -------------------------- 2 files changed, 5 insertions(+), 143 deletions(-) delete mode 100644 .github/workflows/release_testing.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d3a557e7b..57390aa0a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -42,15 +42,6 @@ jobs: - name: libudev-dev if: runner.os == 'Linux' run: sudo apt-get install -y libudev-dev - - name: install ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: "3.0" - bundler-cache: true - - name: install ruby:gem::dotenv - run: gem install dotenv - - name: install ruby:gem::json - run: gem install json - name: install node uses: actions/setup-node@master with: @@ -59,10 +50,14 @@ jobs: uses: hecrj/setup-rust-action@v1 with: rust-version: ${{ matrix.rust }} + - name: Rust Cache + uses: Swatinem/rust-cache@v2.7.3 - name: cargo install nj-cli run: cargo install nj-cli - name: install wasm-pack run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh + - name: Install Build CLI tool + run: cargo install --path=cli - name: enable corepack for yarnpkg upgrade run: | corepack enable @@ -91,9 +86,8 @@ jobs: -k "$KEYCHAIN_PWD" \ "$KEYCHAIN_NAME" - name: build release - working-directory: ./application/holder run: | - rake release:prod --trace + cargo chipmunk release env: KEYCHAIN_NAME: "build.keychain" CSC_LINK: ${{ secrets.CSC_LINK }} diff --git a/.github/workflows/release_testing.yml b/.github/workflows/release_testing.yml deleted file mode 100644 index 28da4a3bf..000000000 --- a/.github/workflows/release_testing.yml +++ /dev/null @@ -1,132 +0,0 @@ -name: BuildAndReleaseMasterForTesting - -# TODO: Reactivate the commented out lines if this file should replace the current active one. -on: - workflow_dispatch: - -jobs: - create_release: - name: Create release - runs-on: ubuntu-latest - outputs: - upload_url: ${{ steps.create_release.outputs.upload_url }} - env: - PUBLISH_FOR_PULL_REQUEST: true - CSC_FOR_PULL_REQUEST: true - steps: - - name: Release - # if: startsWith(github.ref, 'refs/tags/') - id: create_release - uses: softprops/action-gh-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - prerelease: true - tag_name: ${{ github.ref_name }} - # name: ${{ github.ref_name }} - name: "Testing Release" - build_release: - name: Build release - needs: create_release - runs-on: ${{ matrix.os }} - env: - PUBLISH_FOR_PULL_REQUEST: 1 - CSC_FOR_PULL_REQUEST: true - strategy: - matrix: - os: [ubuntu-20.04, windows-latest, macos-13, macOS-latest] - rust: [stable] - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: libudev-dev - if: runner.os == 'Linux' - run: sudo apt-get install -y libudev-dev - - name: install node - uses: actions/setup-node@master - with: - node-version: "current" - - name: install rust - uses: hecrj/setup-rust-action@v1 - with: - rust-version: ${{ matrix.rust }} - # TODO: Remember to use rust cache in the original release file as well or to use cargo-binstall. - - name: Rust Cache - uses: Swatinem/rust-cache@v2.7.3 - - name: cargo install nj-cli - run: cargo install nj-cli - - name: install wasm-pack - run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh - - name: Install Build CLI tool - run: cargo install --path=cli - - name: enable corepack for yarnpkg upgrade - run: | - corepack enable - yarn cache clean - - name: setup keychain for signing and notarising - if: runner.os == 'macOS' - env: - KEYCHAIN_NAME: "build.keychain" - CSC_LINK: ${{ secrets.CSC_LINK }} - CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }} - KEYCHAIN_PWD: ${{ secrets.KEYCHAIN_PWD }} - run: | - security create-keychain -p "$KEYCHAIN_PWD" "$KEYCHAIN_NAME" - security default-keychain -s "$KEYCHAIN_NAME" - certfile="${HOME}/buildcert.p12" - echo "$CSC_LINK" | base64 -d > "$certfile" - security import \ - "$certfile" \ - -P "$CSC_KEY_PASSWORD" \ - -A \ - -k "$KEYCHAIN_NAME" - rm "$certfile" - security set-key-partition-list \ - -S 'apple:' \ - -s \ - -k "$KEYCHAIN_PWD" \ - "$KEYCHAIN_NAME" - - name: build release - run: | - cargo chipmunk release - env: - KEYCHAIN_NAME: "build.keychain" - CSC_LINK: ${{ secrets.CSC_LINK }} - CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }} - APPLEID: ${{ secrets.APPLEID }} - APPLEIDPASS: ${{ secrets.APPLEIDPASS }} - TEAMID: ${{ secrets.TEAMID }} - SIGNING_ID: ${{ secrets.SIGNING_ID }} - KEYCHAIN_PWD: ${{ secrets.KEYCHAIN_PWD }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: list release files - working-directory: ./application/holder/release - run: ls - - name: upload files - # if: startsWith(github.ref, 'refs/tags/') - uses: AButler/upload-release-assets@v2.0 - with: - files: "./application/holder/release/*.tgz;./application/holder/release/*.zip" - repo-token: ${{ secrets.GITHUB_TOKEN }} - release-tag: ${{ github.ref_name }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - invoke_package_distribution: - name: Invoke chipmunk package creation and distribution for different package managers - needs: build_release - runs-on: ubuntu-latest - steps: - - name: Checkout chipmunk-distribution - uses: actions/checkout@v2 - with: - repository: esrlabs/chipmunk-distribution - path: './chipmunk-distribution' - token: ${{secrets.PUSH_TOKEN}} - - name: Push tag - working-directory: ./chipmunk-distribution - run: | - git config user.name "esrlabs" - git config user.email "esrlabs@gmail.com" - git remote set-url origin "https://esrlabs:${{secrets.PUSH_TOKEN}}@github.com/esrlabs/chipmunk-distribution" - git tag ${{ github.ref_name }} - git push origin ${{ github.ref_name }}