-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: switch to cargo workspace * build: setup cargo dist
- Loading branch information
Showing
26 changed files
with
891 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: cargo | ||
- package-ecosystem: github-actions | ||
directory: / | ||
schedule: | ||
interval: monthly | ||
open-pull-requests-limit: 100 | ||
- package-ecosystem: github-actions | ||
- package-ecosystem: cargo | ||
directory: / | ||
schedule: | ||
interval: monthly | ||
open-pull-requests-limit: 100 | ||
- package-ecosystem: cargo | ||
directory: /cli | ||
schedule: | ||
interval: monthly | ||
open-pull-requests-limit: 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
name: release | ||
on: | ||
push: | ||
tags: ["*"] | ||
workflow_dispatch: | ||
jobs: | ||
create-release: | ||
name: Create Release | ||
runs-on: ubuntu-latest | ||
outputs: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
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: true | ||
release: | ||
needs: [create-release] | ||
strategy: | ||
matrix: | ||
include: | ||
- os: windows-latest | ||
artifact-name: kdlfmt-windows-x86_64 | ||
artifact-alias: kdlfmt-win64 | ||
cargo-target: x86_64-pc-windows-msvc | ||
- os: ubuntu-20.04 | ||
artifact-name: kdlfmt-linux-x86_64 | ||
artifact-alias: kdlfmt-linux | ||
cargo-target: x86_64-unknown-linux-gnu | ||
- os: ubuntu-20.04 | ||
artifact-name: kdlfmt-linux-x86_64-musl | ||
cargo-target: x86_64-unknown-linux-musl | ||
#- os: ubuntu-20.04 | ||
# artifact-name: kdlfmt-linux-aarch64 | ||
# cargo-target: aarch64-unknown-linux-gnu | ||
# linker: gcc-aarch64-linux-gnu | ||
- os: macos-latest | ||
artifact-name: kdlfmt-macos-x86_64 | ||
artifact-alias: kdlfmt-macos | ||
cargo-target: x86_64-apple-darwin | ||
- os: macos-latest | ||
artifact-name: kdlfmt-macos-aarch64 | ||
cargo-target: aarch64-apple-darwin | ||
name: Build (${{ matrix.artifact-name }}) | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install Rust | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
target: ${{ matrix.cargo-target }} | ||
- name: Install Linker packages | ||
if: ${{ matrix.linker != '' }} | ||
run: | | ||
sudo apt update | ||
sudo apt install ${{ matrix.linker }} | ||
- name: Build Binary (All features) | ||
run: cargo build --verbose --locked --release --target ${{ matrix.cargo-target }} | ||
env: | ||
CARGO_TARGET_DIR: output | ||
- name: Setup Archive + Extension | ||
shell: bash | ||
run: | | ||
mkdir -p staging | ||
if [ "${{ matrix.os }}" = "windows-latest" ]; then | ||
cp "output/${{ matrix.cargo-target }}/release/kdlfmt.exe" staging/ | ||
cd staging | ||
7z a ../release.zip * | ||
else | ||
cp "output/${{ matrix.cargo-target }}/release/kdlfmt" staging/ | ||
cd staging | ||
zip ../release.zip * | ||
fi | ||
- name: Upload Binary Artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ matrix.artifact-name }} | ||
path: release.zip | ||
- name: Upload Binary to Release | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ needs.create-release.outputs.upload_url }} | ||
asset_path: release.zip | ||
asset_name: ${{ matrix.artifact-name }}.zip | ||
asset_content_type: application/zip | ||
# TODO: Remove this after deprecation notice | ||
- name: Upload Binary to Release aliases | ||
if: ${{ matrix.artifact-alias != '' }} | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ needs.create-release.outputs.upload_url }} | ||
asset_path: release.zip | ||
asset_name: ${{ matrix.artifact-alias }}.zip | ||
asset_content_type: application/zip | ||
release_cargo: | ||
name: Publish to cargo | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install Rust | ||
uses: dtolnay/rust-toolchain@stable | ||
- name: Publish to cargo | ||
run: cargo publish --verbose --locked --token ${{ secrets.CARGO_TOKEN }} |
Oops, something went wrong.