Skip to content

Commit

Permalink
Modify CI to build when version is incremented; increment to v1.0.1 (#…
Browse files Browse the repository at this point in the history
…116)

* trying a new thing that builds only action

* testing more

* test

* test

* test

* test

* test

* test

* test

* version update

* version update

* version update

* version update

* version update

* version update

* version update

* version update

* version update

* version update

* version update

* version update

* version update

* version update

* version update

* version update

* formatting

* CI

* CI

* removed unused action
  • Loading branch information
soldni committed Feb 7, 2024
1 parent 20429f3 commit f6970d5
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 50 deletions.
41 changes: 37 additions & 4 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,35 @@ jobs:
echo "PR base repo: ${{ github.event.pull_request.base.repo.full_name }}/tree/${{ github.event.pull_request.base.ref }}"
echo "PR head repo: ${{ github.event.pull_request.head.repo.full_name }}/tree/${{ github.event.pull_request.head.ref }}"
should_build:
name: "Check if build"
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.ref }}
- name: List branches and tags
run: |
git branch -a
git tag -l
git log | head -n 1000
- id: check_version
run: |
set +e
has_updated=$(git diff --name-only '${{ github.event.pull_request.base.sha }}' | grep -E 'pyproject.toml|Cargo.toml')
is_main_or_release='${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') }}'
if [[ -n "${has_updated}" ]] || [[ "${is_main_or_release}" == 'true' ]]; then
echo "should_build=true" >> $GITHUB_OUTPUT
else
echo "should_build=false" >> $GITHUB_OUTPUT
fi
shell: bash
outputs:
should_build: ${{ steps.check_version.outputs.should_build }}

prepare-venv:
runs-on: ubuntu-latest
name: "Prepare Virtual Env"
Expand Down Expand Up @@ -146,7 +175,8 @@ jobs:
${{ matrix.task.run }}
build-linux:
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') }}
needs: should_build
if: ${{ needs.should_build.outputs.should_build == 'true' }}
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down Expand Up @@ -181,7 +211,8 @@ jobs:
path: dist

build-windows:
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') }}
needs: should_build
if: ${{ needs.should_build.outputs.should_build == 'true' }}
runs-on: windows-latest
name: "Build Windows (${{ matrix.target }})"
strategy:
Expand All @@ -205,7 +236,8 @@ jobs:
path: dist

build-macos:
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') }}
needs: should_build
if: ${{ needs.should_build.outputs.should_build == 'true' }}
runs-on: macos-latest
name: "Build macOS (${{ matrix.target }})"
strategy:
Expand All @@ -229,7 +261,8 @@ jobs:

sdist:
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/') }}
needs: should_build
if: ${{ needs.should_build.outputs.should_build == 'true' }}
steps:
- uses: actions/checkout@v3
- name: Build sdist
Expand Down
87 changes: 43 additions & 44 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "dolma"
version = "1.0.0"
version = "1.0.1"
edition = "2021"
license = "Apache-2.0"

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "dolma"
version = "1.0.0"
version = "1.0.1"
description = "Data filters"
license = {text = "Apache-2.0"}
readme = "README.md"
Expand Down

0 comments on commit f6970d5

Please sign in to comment.