Skip to content

[MAINT] add release workflow #508

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 0 additions & 39 deletions .github/workflows/pythonpackage.yml

This file was deleted.

65 changes: 65 additions & 0 deletions .github/workflows/validate_and_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# - validate the protocol and activities in the repo with reproschema.py
# - triggers a release when a github release is published
name: validate and release

on:
push:
branches:
- main
pull_request:
branches: ['*']
# Allow to trigger the generation of release files automatically
workflow_dispatch:
inputs:
version:
description: 'version number'
required: true
type: string

jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install dependencies
# TODO This installs reproschema from source and not from pypi
# This may not be the optimal way of doing it.
run: |
python -m pip install --upgrade pip setuptools
pip install git+https://github.com/ReproNim/reproschema-py.git
- name: Validate content
run: |
python scripts/jsonParser.py
reproschema validate examples

release:
needs: [validate]
if: github.event == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12

- name: Make a release
run: |
echo "Making a release ${{ inputs.version }}"
mkdir releases/${{ inputs.version }}
cp contexts/reproschema releases/${{ inputs.version }}/base
# python scripts/makeRelease.py ${{ inputs.version }}

- name: Open pull requests to add files
uses: peter-evans/create-pull-request@v6
with:
commit-message: "[REL] adding files to for release ${{ inputs.version }}"
base: main
token: ${{ secrets.GITHUB_TOKEN }}
delete-branch: true
title: "[REL] adding files to for release ${{ inputs.version }}"
body: done via this [GitHub Action](https://github.com/${{ github.repository_owner }}/reproschema/blob/main/.github/workflows/validate_and_release.yml)
Loading