Skip to content

Commit

Permalink
setup actions
Browse files Browse the repository at this point in the history
  • Loading branch information
JeremyMoeglich committed Nov 2, 2024
1 parent 88b37a6 commit 64cd3be
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 1 deletion.
63 changes: 63 additions & 0 deletions .github/workflows/releases.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion src/resolve_spaces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!(
Expand Down

0 comments on commit 64cd3be

Please sign in to comment.