-
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.
pipelines now include: * docker build * ci check * version check * biweekly release
- Loading branch information
Showing
6 changed files
with
153 additions
and
59 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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: ci | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
build-and-test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: set up Rust | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
profile: minimal | ||
override: true | ||
|
||
- name: install dependencies | ||
run: | | ||
rustup component add rustfmt clippy | ||
cargo install cargo-audit | ||
- name: check formatting | ||
run: cargo fmt -- --check | ||
|
||
- name: run linting | ||
run: cargo clippy -- -D warnings | ||
|
||
- name: audit for vulnerabilities | ||
run: cargo audit | ||
|
||
- name: build project | ||
run: cargo build --release | ||
|
||
- name: run tests | ||
run: cargo test | ||
|
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
This file was deleted.
Oops, something went wrong.
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,66 @@ | ||
# Creates tag, release page and uploads release binary to it. | ||
# TODO refactor this with other pipelines. | ||
name: auto-release | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 */14 * *' # Runs every 14 days at midnight UTC | ||
workflow_dispatch: | ||
|
||
jobs: | ||
create-tag-release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# Step 1: Check out the code | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
# Step 2: Calculate the next version tag | ||
- name: Calculate next tag | ||
id: tag_version | ||
run: | | ||
# Fetch existing tags | ||
git fetch --tags | ||
# Get the latest tag and calculate the new version | ||
latest_tag=$(git describe --tags --abbrev=0) | ||
tag_version=${latest_tag:-"v0.0.0"} | ||
# Increment the patch version (you can adjust this to major/minor) | ||
new_version=$(echo $tag_version | awk -F. '{$NF+=1; OFS="."; print $0}') | ||
echo "New version: $new_version" | ||
# Set output for other steps | ||
echo "::set-output name=tag::$new_version" | ||
# Step 3: Build your project (replace with your build process) | ||
- name: Build the project | ||
run: | | ||
# Example build steps (adjust based on your project) | ||
# For example, for Rust: | ||
cargo build --release | ||
# Step 4: Compress build output (optional) | ||
- name: Compress artifacts | ||
run: | | ||
tar -czvf build_artifacts.tar.gz ./target/release/ | ||
# Step 5: Create the new tag | ||
- name: Create new tag | ||
run: | | ||
git tag ${{ steps.tag_version.outputs.tag }} | ||
git push origin ${{ steps.tag_version.outputs.tag }} | ||
# Step 6: Upload the release assets (artifacts) | ||
- name: Create GitHub Release and Upload Artifacts | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ steps.tag_version.outputs.tag }} | ||
release_name: "Release ${{ steps.tag_version.outputs.tag }}" | ||
body: "Automated release for version ${{ steps.tag_version.outputs.tag }}" | ||
draft: false | ||
prerelease: false | ||
files: build_artifacts.tar.gz # Upload the compressed build artifacts |
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,28 @@ | ||
name: version-check | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-and-test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: ensure version has been incremented | ||
run: | | ||
VERSION_BASE=$(git show origin/main:Cargo.toml | grep '^version = ' | awk '{ print $3 }' | tr -d '"') | ||
VERSION_HEAD=$(grep '^version = ' Cargo.toml | awk '{ print $3 }' | tr -d '"') | ||
echo "Base version: $VERSION_BASE" | ||
echo "Head version: $VERSION_HEAD" | ||
if [ "$VERSION_BASE" = "$VERSION_HEAD" ]; then | ||
echo "Error: Cargo.toml version has not been incremented!" | ||
exit 1 | ||
else | ||
echo "Version has been incremented." | ||
fi |
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,6 +1,6 @@ | ||
[package] | ||
name = "tally-cli" | ||
version = "0.1.2" | ||
version = "0.1.3" | ||
authors = ["Dylan Uhryniuk <[email protected]>"] | ||
license = "MIT" | ||
repository = "https://github.com/uhryniuk/tally" | ||
|