diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml new file mode 100644 index 0000000..37055ed --- /dev/null +++ b/.github/workflows/releases.yml @@ -0,0 +1,63 @@ +name: Release + +on: + push: + tags: + - 'v*' # Triggers the workflow on version tags like v1.0.0 + +jobs: + build-and-release: + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - os: ubuntu-latest + target: x86_64-unknown-linux-gnu + extension: '' + - os: macos-latest + target: x86_64-apple-darwin + extension: '' + - os: windows-latest + target: x86_64-pc-windows-msvc + extension: '.exe' + + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Install Rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + target: ${{ matrix.target }} + override: true + + - name: Build the project + run: cargo build --release --target ${{ matrix.target }} + + - name: Prepare binary for release + run: | + mkdir -p release + zip -j release/weaveconfig-${{ matrix.target }}.zip target/${{ matrix.target }}/release/weaveconfig${{ matrix.extension }} + shell: bash + + - name: Create GitHub Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref_name }} + release_name: ${{ github.ref_name }} + draft: false + prerelease: false + + - name: Upload Release Asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: release/weaveconfig-${{ matrix.target }}.zip + asset_name: weaveconfig-${{ matrix.target }}.zip + asset_content_type: application/zip diff --git a/src/resolve_spaces.rs b/src/resolve_spaces.rs index 08c02ce..aba0312 100644 --- a/src/resolve_spaces.rs +++ b/src/resolve_spaces.rs @@ -159,7 +159,7 @@ fn resolve_dependency( } } - if let Some(mut to_merge) = to_merge { + if let Some(to_merge) = to_merge { if let Some(ref mut value) = variables { merge_map_consume(value, to_merge).with_context(|| { format!(