diff --git a/.github/workflows/build-rust.yml b/.github/workflows/build.yml similarity index 100% rename from .github/workflows/build-rust.yml rename to .github/workflows/build.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 57099ec..0243928 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,28 +1,18 @@ name: Publish on: - push: - branches: [ release ] + create: + tags: + - 'v*' # Version tag env: CARGO_TERM_COLOR: always jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - uses: Swatinem/rust-cache@v1.0.1 - - name: Build - run: cargo build --release --verbose - - name: Run tests - run: cargo test --verbose - - name: Publish crate - run: cargo publish --manifest-path kalk/Cargo.toml --token ${{ secrets.CARGO_REGISTRY_TOKEN }} --verbose - - name: Publish CLI - run: cargo publish --manifest-path kalk_cli/Cargo.toml --token ${{ secrets.CARGO_REGISTRY_TOKEN }} --verbose + #- name: Publish crate + #run: cargo publish --manifest-path kalk/Cargo.toml --token ${{ secrets.CARGO_REGISTRY_TOKEN }} --verbose + #- name: Publish CLI + #run: cargo publish --manifest-path kalk_cli/Cargo.toml --token ${{ secrets.CARGO_REGISTRY_TOKEN }} --verbose release: name: release ${{ matrix.target }} @@ -32,8 +22,64 @@ jobs: target: [ubuntu-latest, macos-latest] steps: - uses: actions/checkout@master - - name: Compile and release - uses: PaddiM8/rust-build.action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - EXTRA_FILES: "README.md LICENSE" + - uses: Swatinem/rust-cache@v1.0.1 + - name: Compile + run: | + cargo build --release --verbose + cp target/release/kalk target/release/kalk-${{ runner.os }} + - uses: actions/upload-artifact@v2 + with: + name: binaries + path: target/release/kalk-${{ runner.os }} + + release_windows: + name: release windows + runs-on: windows-latest + + steps: + - uses: actions/checkout@master + - uses: msys2/setup-msys2@v2 + with: + update: true + install: >- + base-devel + pacman-mirrors + diffutils + m4 + make + mingw-w64-x86_64-gcc + mingw-w64-x86_64-rust + + - shell: msys2 {0} + run: | + cargo build --release --verbose + - uses: actions/upload-artifact@v2 + with: + name: binaries + path: target/release/kalk.exe + + create_release: + name: Create Release + needs: [release, release_windows] + runs-on: ubuntu-latest + steps: + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: ${{ github.ref }} + draft: false + prerelease: false + - name: Download Artifact + uses: actions/download-artifact@v2 + with: + name: binaries + - name: Upload Linux Assets + uses: softprops/action-gh-release@v1 + with: + files: ./* + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file