Skip to content

Commit

Permalink
Merge pull request datajoint#25 from yambottle/main
Browse files Browse the repository at this point in the history
DEV-527 DEV-598 Update reusable and starter workflow for opensource repositories, mostly elements
  • Loading branch information
yambottle authored Jul 5, 2024
2 parents f68192c + 38c0bc4 commit 0bfb5f8
Show file tree
Hide file tree
Showing 39 changed files with 183 additions and 449 deletions.
53 changes: 0 additions & 53 deletions .github/workflows/README.md

This file was deleted.

33 changes: 33 additions & 0 deletions .github/workflows/devcontainer-build-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build and Publish DevContainer Image
on:
workflow_call:
secrets:
DOCKERHUB_USERNAME:
required: true
DOCKERHUB_TOKEN:
required: true
jobs:
devcontainer-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo curl https://github.com/mikefarah/yq/releases/download/v4.34.1/yq_linux_amd64\
-Lo /usr/local/bin/yq
sudo chmod +x /usr/local/bin/yq
yq --version
- name: Determine metadata
run: |
PIP_PACKAGE_NAME=$(ls */version.py | cut -d '/' -f 1)
echo "PIP_PACKAGE_NAME=${PIP_PACKAGE_NAME}" >> $GITHUB_ENV
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{secrets.DOCKERHUB_USERNAME}}
password: ${{secrets.DOCKERHUB_TOKEN}}
- name: Build image
run: |
IMAGE=$(yq eval '.services.app.image' ./.devcontainer/docker-compose.yaml)
docker build -t "${IMAGE}" -f ./.devcontainer/Dockerfile .
docker push "${IMAGE}"
5 changes: 4 additions & 1 deletion .github/workflows/devcontainer-build.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
name: Build DevContainer Image
name: Deprecated:Build DevContainer Image
on:
workflow_call:
jobs:
devcontainer-build:
runs-on: ubuntu-latest
steps:
- name: Deprecation Warning
run: |
echo "This action is deprecated. Please use the 'Build and Publish DevContainer Image' reusable workflow instead."
- uses: actions/checkout@v3
- name: Install dependencies
run: |
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/devcontainer-publish.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish DevContainer Image
name: Deprecated:Publish DevContainer Image
on:
workflow_call:
secrets:
Expand All @@ -10,6 +10,9 @@ jobs:
devcontainer-publish:
runs-on: ubuntu-latest
steps:
- name: Deprecation Warning
run: |
echo "This action is deprecated. Please use the 'Build and Publish DevContainer Image' reusable workflow instead."
- uses: actions/checkout@v3
- name: Install dependencies
run: |
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/make_github_release.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: make_github_release
name: Deprecated:make_github_release
on:
workflow_call:
outputs:
Expand All @@ -11,6 +11,9 @@ jobs:
outputs:
gh_release_upload_url: ${{ steps.get_release_upload_url.outputs.upload_url }}
steps:
- name: Deprecation Warning
run: |
echo "This action is deprecated. Please use the 'Semantic Release' reusable workflow instead."
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
Expand Down
94 changes: 94 additions & 0 deletions .github/workflows/semantic-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: semantic-release
on:
workflow_call:

jobs:
release:
runs-on: ubuntu-latest
concurrency: release
permissions:
id-token: write
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
# fixed: https://github.com/python-semantic-release/python-semantic-release/issues/721
- name: Find version.py
id: find_version_dot_py
run: |
echo "version_dot_py_path=$(find * -name "version.py" | head -n 1)" >> $GITHUB_OUTPUT
- name: Config python-semantic-release
env:
VERSION_DOT_PY_PATH: ${{ steps.find_version_dot_py.outputs.version_dot_py_path }}
run: |
cat <<EOF > .semantic-release.toml
[tool.semantic_release]
assets = []
build_command_env = []
commit_message = "{version}\n\nAutomatically generated by python-semantic-release"
commit_parser = "angular"
logging_use_named_masks = true #
major_on_zero = true
allow_zero_version = true
no_git_verify = false
tag_format = "{version}" #
version_variables = [
"${VERSION_DOT_PY_PATH}:__version__" #
]
[tool.semantic_release.branches.main]
match = "(main|master)"
prerelease_token = "rc"
prerelease = false
[tool.semantic_release.changelog]
template_dir = "templates"
changelog_file = "CHANGELOG.md"
exclude_commit_patterns = []
[tool.semantic_release.changelog.environment]
block_start_string = "{%"
block_end_string = "%}"
variable_start_string = "{{"
variable_end_string = "}}"
comment_start_string = "{#"
comment_end_string = "#}"
trim_blocks = false
lstrip_blocks = false
newline_sequence = "\n"
keep_trailing_newline = false
extensions = []
autoescape = true
[tool.semantic_release.commit_author]
env = "GIT_COMMIT_AUTHOR"
default = "semantic-release <semantic-release>"
[tool.semantic_release.commit_parser_options]
allowed_tags = ["build", "chore", "ci", "docs", "feat", "fix", "perf", "style", "refactor", "test"]
minor_tags = ["feat"]
patch_tags = ["fix", "perf"]
default_bump_level = 0
[tool.semantic_release.remote]
name = "origin"
type = "github"
ignore_token_for_push = false
insecure = false
[tool.semantic_release.publish]
dist_glob_patterns = ["dist/*"]
upload_to_vcs_release = true
EOF
echo "INFO::Semantic release configuration:"
cat .semantic-release.toml
git config --global --add safe.directory ${PWD}
- name: Python Semantic Release
uses: python-semantic-release/python-semantic-release@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
root_options: "-c .semantic-release.toml -v"
28 changes: 0 additions & 28 deletions .staging_workflows/anchored_u24_element_before_release.yaml

This file was deleted.

59 changes: 0 additions & 59 deletions .staging_workflows/anchored_u24_element_release_call.yaml

This file was deleted.

25 changes: 0 additions & 25 deletions .staging_workflows/anchored_u24_element_tag_to_release.yaml

This file was deleted.

29 changes: 0 additions & 29 deletions .staging_workflows/anchored_u24_workflow_before_release.yaml

This file was deleted.

Loading

0 comments on commit 0bfb5f8

Please sign in to comment.