diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c6545bb..6fd127e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,17 +9,18 @@ jobs: create-release: name: create-release runs-on: ubuntu-latest + outputs: + upload_url: ${{ steps.release.outputs.upload_url }} + rg_version: ${{ env.RG_VERSION }} steps: - - name: Create artifacts directory - run: mkdir artifacts - - name: Get the release version from the tag + shell: bash if: env.ACRE_VERSION == '' run: | # Apparently, this is the right way to get a tag name. Really? # # See: https://github.community/t5/GitHub-Actions/How-to-get-just-the-tag-name/m-p/32167/highlight/true#M1027 - echo "::set-env name=ACRE_VERSION::${GITHUB_REF#refs/tags/}" + echo "ACRE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV echo "version is: ${{ env.ACRE_VERSION }}" - name: Create GitHub release id: release @@ -30,18 +31,6 @@ jobs: tag_name: ${{ env.ACRE_VERSION }} release_name: ${{ env.ACRE_VERSION }} - - name: Save release upload URL to artifact - run: echo "${{ steps.release.outputs.upload_url }}" > artifacts/release-upload-url - - - name: Save version number to artifact - run: echo "${{ env.ACRE_VERSION }}" > artifacts/release-version - - - name: Upload artifacts - uses: actions/upload-artifact@v1 - with: - name: artifacts - path: artifacts - build-release: name: build-release needs: ['create-release'] @@ -62,11 +51,11 @@ jobs: include: - build: linux os: ubuntu-18.04 - rust: nightly + rust: stable target: x86_64-unknown-linux-musl - build: macos os: macos-latest - rust: nightly + rust: stable target: x86_64-apple-darwin steps: @@ -84,34 +73,19 @@ jobs: target: ${{ matrix.target }} - name: Use Cross - # if: matrix.os != 'windows-2019' + shell: bash run: | - # FIXME: to work around bugs in latest cross release, install master. - # See: https://github.com/rust-embedded/cross/issues/357 - cargo install --git https://github.com/rust-embedded/cross - echo "::set-env name=CARGO::cross" - echo "::set-env name=TARGET_FLAGS::--target ${{ matrix.target }}" - echo "::set-env name=TARGET_DIR::./target/${{ matrix.target }}" + cargo install cross + echo "CARGO=cross" >> $GITHUB_ENV + echo "TARGET_FLAGS=--target ${{ matrix.target }}" >> $GITHUB_ENV + echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV + - name: Show command used for Cargo run: | echo "cargo command is: ${{ env.CARGO }}" echo "target flag is: ${{ env.TARGET_FLAGS }}" echo "target dir is: ${{ env.TARGET_DIR }}" - - name: Get release download URL - uses: actions/download-artifact@v1 - with: - name: artifacts - path: artifacts - - name: Set release upload URL and release version - shell: bash - run: | - release_upload_url="$(cat artifacts/release-upload-url)" - echo "::set-env name=RELEASE_UPLOAD_URL::$release_upload_url" - echo "release upload url: $RELEASE_UPLOAD_URL" - release_version="$(cat artifacts/release-version)" - echo "::set-env name=RELEASE_VERSION::$release_version" - echo "release version: $RELEASE_VERSION" - name: Build release binary run: ${{ env.CARGO }} build --verbose --release ${{ env.TARGET_FLAGS }} @@ -124,7 +98,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - upload_url: ${{ env.RELEASE_UPLOAD_URL }} + upload_url: ${{ needs.create-release.outputs.upload_url }} asset_path: target/${{ matrix.target }}/release/acre asset_name: acre-${{ matrix.build }} asset_content_type: application/octet-stream diff --git a/Cargo.lock b/Cargo.lock index e4f65cb..03f8a17 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,8 +1,10 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +version = 3 + [[package]] name = "acre" -version = "0.3.3" +version = "0.4.0" dependencies = [ "anyhow", "crossbeam-channel",