-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
766 additions
and
1,900 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,19 +1,5 @@ | ||
pattern = 'v0.3.%d' | ||
pattern = 'v0.4.%d' | ||
message-template = "Created {version} for release." | ||
|
||
[cargo] | ||
|
||
[artifact.windows] | ||
paths = { "crom.exe" = "windows/crom.exe" } | ||
compress = { name = "crom-windows.zip", format = "zip" } | ||
target = "GitHub" | ||
|
||
[artifact.mac] | ||
paths = {crom = "mac/crom"} | ||
compress = { name = "crom-mac.tar.gz", format = "tgz" } | ||
target = "GitHub" | ||
|
||
[artifact.linux] | ||
paths = {crom = "linux/crom"} | ||
compress = { name = "crom-linux-musl.tar.gz", format = "tgz" } | ||
target = "GitHub" |
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,94 @@ | ||
name: Publish Image | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
version: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
build-for-os: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
build: [linux, macos-x86, macos-aarch64] | ||
include: | ||
- build: linux | ||
os: ubuntu-latest | ||
target: x86_64-unknown-linux-gnu | ||
- build: macos-x86 | ||
os: macos-latest | ||
target: x86_64-apple-darwin | ||
- build: macos-aarch64 | ||
os: macos-latest | ||
target: aarch64-apple-darwin | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: ${{ runner.os }}-${{ matrix.target }}-cargo-release-${{ hashFiles('ci/cache-version') }}-${{ hashFiles('**/Cargo.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ matrix.target }}-cargo-release-${{ hashFiles('ci/cache-version') }}- | ||
${{ runner.os }}-${{ matrix.target }}-cargo-${{ hashFiles('ci/cache-version') }}- | ||
- name: Install correct version of Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
target: ${{ matrix.target }} | ||
override: true | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: run | ||
args: -- write-version custom ${{ inputs.version }} | ||
- uses: actions-rs/cargo@v1 | ||
with: | ||
command: build | ||
args: --verbose --release --target "${{ matrix.target }}" | ||
- run: | | ||
ls target/${{ matrix.target }}/* | ||
- name: Upload Artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ matrix.target }} | ||
if-no-files-found: error | ||
path: | | ||
target/${{ matrix.target }}/release/crom | ||
release: | ||
runs-on: ubuntu-latest | ||
needs: build-for-os | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: aarch64-apple-darwin | ||
path: artifacts/aarch64-apple-darwin | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: x86_64-apple-darwin | ||
path: artifacts/x86_64-apple-darwin | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: x86_64-unknown-linux-gnu | ||
path: artifacts/x86_64-unknown-linux-gnu | ||
- name: Create release | ||
env: | ||
GH_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
run: | | ||
ls artifacts/*/* | ||
mkdir artifacts-to-publish | ||
tar -czv --strip-components 1 -f artifacts-to-publish/crom-${{ inputs.version }}-linux-gnu-x86_64.tgz -C artifacts/x86_64-unknown-linux-gnu crom | ||
tar -czv --strip-components 1 -f artifacts-to-publish/crom-${{ inputs.version }}-darwin-aarch64.tgz -C artifacts/aarch64-apple-darwin crom | ||
tar -czv --strip-components 1 -f artifacts-to-publish/crom-${{ inputs.version }}-darwin-x86_64.tgz -C artifacts/x86_64-apple-darwin crom | ||
gh release upload ${{ inputs.version }} artifacts-to-publish/* |
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,85 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
name: Release | ||
|
||
jobs: | ||
create-release: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
version: ${{ steps.version.outputs.version }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('ci/cache-version') }}-${{ hashFiles('**/Cargo.lock') }} | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
override: true | ||
- name: create pre-release | ||
id: version | ||
env: | ||
GH_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
run: | | ||
VERSION=$(cargo run -- get next-release) | ||
gh release create $VERSION --generate-notes --target $(git rev-parse HEAD) | ||
echo "::set-output name=version::$VERSION" | ||
publish: | ||
uses: ./.github/workflows/create-artifacts.yml | ||
needs: create-release | ||
with: | ||
version: ${{ needs.create-release.outputs.version }} | ||
|
||
check: | ||
name: Check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('ci/cache-version') }}-${{ hashFiles('**/Cargo.lock') }} | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
override: true | ||
- name: cargo check | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: check | ||
## Cargo test | ||
- name: cargo test | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
## Cargo fmt | ||
- run: rustup component add rustfmt | ||
- name: cargo fmt | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: fmt | ||
args: --all -- --check | ||
## Cargo clippy | ||
- run: rustup component add clippy | ||
- name: cargo clippy | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: clippy | ||
args: -- -D warnings |
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,84 @@ | ||
on: [pull_request] | ||
|
||
name: Continuous integration | ||
|
||
jobs: | ||
create-release: | ||
needs: | ||
- check | ||
runs-on: ubuntu-latest | ||
outputs: | ||
version: ${{ steps.version.outputs.version }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('ci/cache-version') }}-${{ hashFiles('**/Cargo.lock') }} | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
override: true | ||
- name: create pre-release | ||
id: version | ||
env: | ||
GH_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
run: | | ||
VERSION=$(cargo run -- get pre-release) | ||
gh release create $VERSION --generate-notes --prerelease --target $(git rev-parse HEAD) | ||
echo "::set-output name=version::$VERSION" | ||
publish: | ||
uses: ./.github/workflows/create-artifacts.yml | ||
needs: create-release | ||
with: | ||
version: ${{ needs.create-release.outputs.version }} | ||
|
||
check: | ||
name: Check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cargo/bin/ | ||
~/.cargo/registry/index/ | ||
~/.cargo/registry/cache/ | ||
~/.cargo/git/db/ | ||
target/ | ||
key: ${{ runner.os }}-cargo-${{ hashFiles('ci/cache-version') }}-${{ hashFiles('**/Cargo.lock') }} | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
override: true | ||
- name: cargo check | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: check | ||
## Cargo test | ||
- name: cargo test | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
## Cargo fmt | ||
- run: rustup component add rustfmt | ||
- name: cargo fmt | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: fmt | ||
args: --all -- --check | ||
## Cargo clippy | ||
- run: rustup component add clippy | ||
- name: cargo clippy | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: clippy | ||
args: -- -D warnings |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.