diff --git a/.bumpversion.cfg b/.bumpversion.cfg index ed2aae3b..d225f2e0 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -5,5 +5,5 @@ message = :bookmark: Bump version: {current_version} โ†’ {new_version} tag = True [bumpversion:file:simzoo/version.py] - [bumpversion:file:setup.cfg] +[bumpversion:file:package.json] \ No newline at end of file diff --git a/.github/workflows/update_semver.yml b/.github/workflows/autotag_ci.yml similarity index 100% rename from .github/workflows/update_semver.yml rename to .github/workflows/autotag_ci.yml diff --git a/.github/workflows/release-changelog-builder-config.json b/.github/workflows/release-changelog-builder-config.json new file mode 100644 index 00000000..d47a5cb5 --- /dev/null +++ b/.github/workflows/release-changelog-builder-config.json @@ -0,0 +1,32 @@ +{ + "categories": [ + { + "title": "## ๐Ÿš€ Features", + "labels": ["feature"] + }, + { + "title": "## ๐Ÿ› Fixes", + "labels": ["fix"] + }, + { + "title": "## ๐Ÿงช Tests", + "labels": ["test"] + }, + { + "title": "## ๐Ÿ“ Tests", + "labels": ["docs"] + }, + { + "title": "## ๐Ÿ’š CI", + "labels": ["CI"] + }, + { + "title": "## ๐Ÿ”’ Security", + "labels": ["security"] + }, + { + "title": "## ๐Ÿ”„ Dependency updates", + "labels": ["dependencies"] + } + ] +} diff --git a/.github/workflows/release_ci.yml b/.github/workflows/release_ci.yml new file mode 100644 index 00000000..c5e65266 --- /dev/null +++ b/.github/workflows/release_ci.yml @@ -0,0 +1,124 @@ +# Github action that makes sure that all the version tags are up to date when +# A new version tag is added. +name: Ex3_ekf release CI +on: + push: + tags: + - v*.*.* +jobs: + update-code-version: + runs-on: ubuntu-latest + if: github.event.action != 'labeled' + steps: + # NOTE: Updates the version that is specified in the code files. + - name: Checkout repository + uses: actions/checkout@v2 + with: + ref: ${{ github.ref }} + fetch-depth: 0 + - name: Get current semver tag + id: get_semver + uses: rickstaa/action-get-semver@v1 + with: + verbose: "true" + # Use bumpversion to update version in code + # See. https://pypi.org/project/bump2version/ + - name: Set up Python environment + uses: actions/setup-python@v2 + with: + python-version: 3.7 + - name: Cache python environment + uses: actions/cache@v2 + id: cache-python-env + with: + path: ${{ env.pythonLocation }} + key: ${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ hashFiles('setup.cfg') }}-${{ hashFiles('pyproject.toml') }}-bumpversion + - name: Update pip + if: steps.cache-python-env.outputs.cache-hit != 'true' + run: | + python -m pip install --upgrade pip + - name: Install bump2version + if: steps.cache-python-env.outputs.cache-hit != 'true' + run: | + pip install bump2version + - name: Make sure the version in all code files is correct + run: | + bumpversion --no-tag --no-commit --new-version ${{ steps.get_semver.outputs.current_version }} patch + - name: Commit code version changes + uses: stefanzweifel/git-auto-commit-action@v4 + with: + branch: main + commit_message: ":bookmark: Updates documentation version to ${{ steps.get_semver.outputs.current_version }}" + release-changelog: + runs-on: ubuntu-latest + needs: update-code-version + if: github.event.action != 'labeled' + steps: + # NOTE: Makes sure the changelog is up to date. + - name: Checkout repository + uses: actions/checkout@v2 + with: + ref: ${{ github.ref }} + fetch-depth: 0 + - uses: actions/setup-node@v2 + with: + node-version: "12" + - name: Install auto-changelog + run: npm install + - name: Create CHANGELOG.md file using auto-changelog + run: npm run auto-changelog + - name: Commit changelog changes + uses: stefanzweifel/git-auto-commit-action@v4 + with: + branch: main + commit_message: ":memo: Updates CHANGELOG.md" + move-semver-tags: + runs-on: ubuntu-latest + needs: release-changelog + if: github.event.action != 'labeled' + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + ref: main + fetch-depth: 0 + - name: Get latest semver tag + id: get_semver + uses: rickstaa/action-get-semver@v1 + with: + verbose: "true" + - name: Updates major and minor version tags + uses: rickstaa/action-update-semver@v1 + with: + tag: "${{ steps.get_semver.outputs.current_version }}" + create-pre-release: + # NOTE: Creates a pre-release for the new tag + runs-on: ubuntu-latest + needs: move-semver-tags + if: github.event.action != 'labeled' + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + ref: main + fetch-depth: 0 + - name: Get latest semver tag + id: get_semver + uses: rickstaa/action-get-semver@v1 + with: + verbose: "true" + - name: Build release changelog + id: build_changelog + uses: mikepenz/release-changelog-builder-action@main + env: + configuration: ".github/workflows/release-changelog-builder-config.json" + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Create pre-release + uses: actions/create-release@v1 + with: + tag_name: ${{ steps.get_semver.outputs.current_version }} + release_name: ${{ steps.get_semver.outputs.current_version }} + body: ${{ steps.build_changelog.outputs.changelog }} + prerelease: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/package.json b/package.json new file mode 100644 index 00000000..4c340552 --- /dev/null +++ b/package.json @@ -0,0 +1,21 @@ +{ + "name": "Simzoo", + "version": "0.2.2", + "repository": { + "type": "git", + "url": "git@github.com:rickstaa/simzoo.git" + }, + "license": "UNLICENSED", + "devDependencies": { + "auto-changelog": "^2.2.1" + }, + "scripts": { + "auto-changelog": "auto-changelog -p && git add CHANGELOG.md" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false + } +} diff --git a/simzoo/envs/README.md b/simzoo/envs/README.md new file mode 100644 index 00000000..f826d1ad --- /dev/null +++ b/simzoo/envs/README.md @@ -0,0 +1,6 @@ +# envs + +This folder contains the following submodules: + +- [ex3_ekf](https://github.com/rickstaa/ex3-ekf):A gym environment for a noisy master-slave system. +- [oscillator](https://github.com/rickstaa/oscillator):A gym environment for a synthetic oscillatory network of transcriptional regulators called a repressilator. diff --git a/simzoo/envs/ex3_ekf b/simzoo/envs/ex3_ekf index 2d0d0286..3e72b960 160000 --- a/simzoo/envs/ex3_ekf +++ b/simzoo/envs/ex3_ekf @@ -1 +1 @@ -Subproject commit 2d0d02869c1ec11193973bd5ce186253e6aa60a3 +Subproject commit 3e72b960827904272046ab4479f0c3c40189cb02 diff --git a/simzoo/envs/oscillator b/simzoo/envs/oscillator index 0c6b6db8..a9a6f5ea 160000 --- a/simzoo/envs/oscillator +++ b/simzoo/envs/oscillator @@ -1 +1 @@ -Subproject commit 0c6b6db8704dbab609738413d0f0d51b5a2ff03a +Subproject commit a9a6f5eaf00ee6dc22af2b7c55e5b7d848ad4dab