Skip to content

Commit

Permalink
in progress: release new
Browse files Browse the repository at this point in the history
  • Loading branch information
alaviss committed Jul 7, 2024
1 parent aaba3c5 commit c51e263
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 24 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,26 @@ on:
merge_group:
# Test all additions to merge queue

workflow_call:
# Allow the workflow to be reused elsewhere

# Run every script actions in bash
defaults:
run:
shell: bash

jobs:
cancel:
if: github.event == 'merge_group' || github.event == 'pull_request'
name: Cancel previous runs (Merge Queue/PR)
runs-on: ubuntu-latest

permissions:
actions: write

steps:
- uses: pierreraffa/[email protected]

pre_run:
name: Provide additional context for the workflow
runs-on: ubuntu-latest
Expand All @@ -42,24 +56,10 @@ jobs:
shared_builder: ${{ steps.matrix.outputs.shared }}

steps:
- id: run_cond
uses: fkirc/[email protected]
with:
# Cancel CI on outdated commits
cancel_others: true
# Don't skip when a duplicated run (ie. from a PR) is done.
#
# Only CI in upstream has docs publishing rights.
skip_after_successful_duplicate: false
# Do not skip on push, dispatched or cron
do_not_skip: '["push", "workflow_dispatch", "schedule"]'

- id: skip_result
name: Whether to skip checks
run: |
if [[ '${{ steps.run_cond.outputs.should_skip }}' == true ]]; then
echo "result=true" >> $GITHUB_OUTPUT
elif [[ '${{ github.event.pull_request.draft }}' == true ]]; then
if [[ '${{ github.event.pull_request.draft }}' == true ]]; then
echo "Pull request is in draft state, skipping"
echo "result=true" >> $GITHUB_OUTPUT
else
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/leak.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ on:
merge_group:

jobs:
cancel:
if: github.event == 'merge_group'
name: Cancel previous runs (Merge Queue)
runs-on: ubuntu-latest

permissions:
actions: write

steps:
- uses: pierreraffa/[email protected]

leaktest:
# Skip this for PRs
if: github.event_name != 'pull_request'
Expand Down
42 changes: 33 additions & 9 deletions .github/workflows/publisher.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ on:
branches:
- devel

workflow_call:
inputs:
run_id:
required: false
type: string
description: The run ID with artifacts to be published
default: ${{ github.run_id }}

# Run every script actions in bash
defaults:
run:
Expand All @@ -28,13 +36,20 @@ jobs:
- name: Obtain latest successful run id
id: finder
run: |
run_id=$(gh run list \
-c "$COMMIT" \
-w "$WORKFLOW" \
-s "$CONCLUSION" \
--limit 1 \
--json databaseId \
--jq '.[].databaseId')
run_id=
if [[ -n $INPUT_RUNID ]]; then
echo "Using input run id"
run_id=$INPUT_RUNID
else
echo "Querying latest run id for $COMMIT"
run_id=$(gh run list \
-c "$COMMIT" \
-w "$WORKFLOW" \
-s "$CONCLUSION" \
--limit 1 \
--json databaseId \
--jq '.[].databaseId')
fi
if [[ -z $run_id ]]; then
echo "::error::Could not find any CI run for commit $COMMIT"
exit 1
Expand All @@ -46,6 +61,7 @@ jobs:
CONCLUSION: success
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
INPUT_RUNID: ${{ inputs.run_id }}

# Download the latest instance of artifacts from a build done previously
- name: Download generated source archive
Expand Down Expand Up @@ -91,14 +107,22 @@ jobs:
$toUpload
$delimiter
EOF
echo "version=$(./release_manifest version)" >> $GITHUB_OUTPUT
version=$(./release_manifest version)
prerelease=true
[[ $version == *-* ]] || prerelease=false
echo "version=$version" >> $GITHUB_OUTPUT
echo "prerelease=$prerelease" >> $GITHUB_OUTPUT
working-directory: release-staging

- id: release-desc
name: Create release description
run: |
- id: release
name: Create pre-release
uses: softprops/[email protected]
with:
prerelease: true
prerelease: ${{ steps.release-files.outputs.prerelease }}
files: ${{ steps.release-files.outputs.result }}
tag_name: ${{ steps.release-files.outputs.version }}
fail_on_unmatched_files: true
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/reproducible.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@ on:
merge_group:

jobs:
cancel:
if: github.event == 'merge_group'
name: Cancel previous runs (Merge Queue)
runs-on: ubuntu-latest

permissions:
actions: write

steps:
- uses: pierreraffa/[email protected]

reprotest:
# This job is meant for testing whether the compiler can be built
# reproducibly given the same build environment.
Expand Down

0 comments on commit c51e263

Please sign in to comment.