From 76726b1e3c9db2a5f83db07bc2d54d90f8e15680 Mon Sep 17 00:00:00 2001 From: Mertcan D <54983926+mertcandav@users.noreply.github.com> Date: Mon, 7 Aug 2023 00:20:43 +0300 Subject: [PATCH] Various optimizations (#7) * Update action.yml * Update action.yml Co-authored-by: David Leal * Update action.yml * Update action.yml --------- Co-authored-by: David Leal --- action.yml | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/action.yml b/action.yml index 3c3c433..654f638 100644 --- a/action.yml +++ b/action.yml @@ -35,20 +35,24 @@ runs: echo "The action doesn't support building on Windows. Exiting script." exit 1 fi - - name: Install Homebrew + - name: Install Homebrew if Needed shell: bash run: | - /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - if [[ "$OSTYPE" == "darwin"* ]]; then - echo 'export PATH="/usr/local/bin:$PATH"' >> $GITHUB_PATH - elif [[ "$OSTYPE" == "linux-gnu"* ]]; then - echo "export PATH=\$PATH:/home/linuxbrew/.linuxbrew/bin" >> $GITHUB_PATH + if [[ ${{ inputs.version }} == "latest" ]] || [[ ${{ inputs.version }} == "current" ]]; then + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + if [[ "$OSTYPE" == "darwin"* ]]; then + echo 'export PATH="/usr/local/bin:$PATH"' >> $GITHUB_PATH + elif [[ "$OSTYPE" == "linux-gnu"* ]]; then + echo "export PATH=\$PATH:/home/linuxbrew/.linuxbrew/bin" >> $GITHUB_PATH + fi fi - name: Install dependencies shell: bash run: | - brew update - brew install wget jq + if [[ ${{ inputs.version }} == "latest" ]] || [[ ${{ inputs.version }} == "current" ]]; then + brew update + brew install jq + fi - name: Adjust directory shell: bash run: | @@ -64,13 +68,13 @@ runs: RELEASES=$(curl -s https://api.github.com/repos/julelang/jule/releases) LATEST_RELEASE=$(echo "$RELEASES" | jq -r '.[] | select(.draft == false) | .tarball_url' | head -n 1) - wget $LATEST_RELEASE -O julec.tar.gz + curl -o julec.tar.gz $LATEST_RELEASE mkdir -p ${{ inputs.directory }}/julec-latest tar -xzf julec.tar.gz -C ${{ inputs.directory }}/julec-latest elif [[ ${{ inputs.version }} == "dev" ]]; then git clone https://github.com/julelang/jule.git ${{ inputs.directory }}/julec-${{ inputs.version }} else - wget https://github.com/julelang/jule/archive/refs/tags/jule-${{ inputs.version }}.tar.gz -O julec.tar.gz + curl -o julec.tar.gz https://github.com/julelang/jule/archive/refs/tags/jule-${{ inputs.version }}.tar.gz -O julec.tar.gz mkdir -p ${{ inputs.directory }}/julec-${{ inputs.version }} tar -xzf julec.tar.gz -C ${{ inputs.directory }}/julec-${{ inputs.version }} fi @@ -78,7 +82,7 @@ runs: shell: bash run: | cd ${{ inputs.directory }}/julec-${{ inputs.version }} - wget https://raw.githubusercontent.com/julelang/julec-ir/main/src/$( [[ "$OSTYPE" == "darwin"* ]] && echo darwin || echo linux)-${{ inputs.architecture }}.cpp -O ir.cpp + curl -o ir.cpp https://raw.githubusercontent.com/julelang/julec-ir/main/src/$( [[ "$OSTYPE" == "darwin"* ]] && echo darwin || echo linux)-${{ inputs.architecture }}.cpp - name: Compile JuleC shell: bash run: |