forked from ada-url/ada
-
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.
feat: make actions send a PR instead of push to main (ada-url#340)
* releases: pr instead of push into main directly * releases: adds release_create for testing * releases: use startsWith instead * releases: remove actions as requirement * releases: trigger actions only on pr authored by github actions * releases: trying to tcheck actions's commiter email * releases: remove commiter trial * releases: make release-script-tests a reusable workflow * releases: adds extra permissions + run create_release script * releases: adds missing github token * releases: fix fbug on first releases * releases: refactoring to include co-authors + adds type hints * releases: specify dependency versions in requirements.txt * releases: types based on classes instead of modules * releases: remove cache python dependencies * releases: fix requirements.txt install location * releases: not list release pull rrequests * releases: fix capital C * releases: adds missing end of line * releases: use commit hash instead of version directly for peter-evans/create-pull-request * releases: change pytest level of verbosity to be just -v * releases: remove release.yml workflow * releases: format release.py * releases: adds check for pull request created by actions bot * releases: run create-release workflow only if pull_request.user.login starts with 'github-actions' * releases: run create-release workflow only if pull_request.user.login starts with 'github-actions' * releases: adds flake8-annotations rule * releaseS: adds missing && in release_create.yml * releases: add missing test + missing condition to PRs for next release
- Loading branch information
1 parent
77c170b
commit 1fd49eb
Showing
11 changed files
with
714 additions
and
320 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
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,48 @@ | ||
name: Release Create Workflow | ||
|
||
on: | ||
pull_request: | ||
types: [closed] | ||
|
||
permissions: | ||
contents: write | ||
|
||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
jobs: | ||
release-script-test: | ||
uses: ./.github/workflows/release-script-tests.yml | ||
|
||
create-release: | ||
needs: release-script-test | ||
runs-on: ubuntu-latest | ||
if: > | ||
${{ needs.release-script-test.result == 'success' }} && | ||
github.event.pull_request.merged == true && | ||
github.event.pull_request.base.ref == 'main' && | ||
startsWith(github.event.pull_request.head.ref, 'release/v') && | ||
startsWith(github.event.pull_request.user.login, 'github-actions') | ||
env: | ||
NEXT_RELEASE_TAG: ${{ github.event.pull_request.head.ref }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 | ||
|
||
- name: Install dependencies | ||
run: pip3 install -r ./tools/release/requirements.txt | ||
|
||
- name: Extract Tag from branch name | ||
run: | | ||
NEXT_RELEASE_TAG=$(echo $NEXT_RELEASE_TAG | sed 's/^release\///') | ||
echo "NEXT_RELEASE_TAG=${NEXT_RELEASE_TAG}" >> $GITHUB_ENV | ||
- name: Target release Tag | ||
run: echo "New tag $NEXT_RELEASE_TAG" | ||
|
||
- name: Amalgamation | ||
run: ./singleheader/amalgamate.py | ||
|
||
- name: "Create release" | ||
run: ./tools/release/create_release.py |
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,51 @@ | ||
name: Release Prepare Workflow | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
type: string | ||
required: true | ||
description: "Tag for the next release. Ex.: v5.0.0" | ||
|
||
env: | ||
NEXT_RELEASE_TAG: ${{ github.event.inputs.tag }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
release-script-test: | ||
uses: ./.github/workflows/release-script-tests.yml | ||
|
||
prepare-release-and-pull-request: | ||
needs: release-script-test | ||
runs-on: ubuntu-latest | ||
if: ${{ needs.release-script-test.result == 'success' }} | ||
env: | ||
CXX: clang++-14 | ||
steps: | ||
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0 | ||
|
||
- name: Install dependencies | ||
run: pip3 install -r ./tools/release/requirements.txt | ||
|
||
- name: Update source code versions | ||
run: ./tools/release/update_versions.py | ||
|
||
- name: Ada Build | ||
run: cmake -B build && cmake --build build | ||
- name: Ada Test | ||
run: ctest --output-on-failure --test-dir build | ||
|
||
- name: Create PR with code updates for new release | ||
uses: peter-evans/create-pull-request@f3a21bf3404eae73a97f65817ab35f351a1a63fe #v5.0.0 | ||
with: | ||
commit-message: "chore: release ${{ env.NEXT_RELEASE_TAG }}" | ||
branch: "release/${{ env.NEXT_RELEASE_TAG }}" | ||
title: "chore: release ${{ env.NEXT_RELEASE_TAG }}" | ||
token: ${{ env.GITHUB_TOKEN }} | ||
body: | | ||
This pull PR updates the source code version to ${{ env.NEXT_RELEASE_TAG }} |
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
Oops, something went wrong.