-
Notifications
You must be signed in to change notification settings - Fork 796
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle v5-09-59 series and remove unnecessary fetches
- Loading branch information
1 parent
cccc34c
commit 15b197e
Showing
1 changed file
with
30 additions
and
48 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
name: Prepare AliPhysics tag and start build | ||
--- | ||
name: Prepare AliPhysics tag | ||
|
||
on: | ||
'on': | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: 'Tag to prepare' | ||
required: true | ||
default: 'v5-09-XXy-01' | ||
|
||
permissions: {} | ||
|
||
jobs: | ||
build: | ||
permissions: | ||
|
@@ -16,51 +19,30 @@ jobs: | |
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Decide which branch to use | ||
run: | | ||
cat << EOF >> "$GITHUB_OUTPUT" | ||
branch=$(echo ${{ github.event.inputs.tag }}-patches | sed -e's/[a-z][a-z]*-01-patches$/-01-patches/') | ||
aliroot_tag=$(echo ${{ github.event.inputs.tag }} | sed -e's/-01$//') | ||
EOF | ||
id: decide_release_branch | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: "master" | ||
- name: Tag branch (or create one before tagging if does not exists) | ||
run: | | ||
set -x | ||
git fetch origin | ||
git checkout -B ${{ steps.decide_release_branch.outputs.branch }} origin/${{ steps.decide_release_branch.outputs.branch }} | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "ALICE Action Bot" | ||
git push --set-upstream origin ${{ steps.decide_release_branch.outputs.branch }} | ||
git tag ${{ github.event.inputs.tag }} | ||
git push --set-upstream origin ${{ github.event.inputs.tag }} | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | ||
with: | ||
tag_name: ${{ github.event.inputs.tag }} | ||
release_name: ${{ github.event.inputs.tag }} | ||
draft: false | ||
prerelease: false | ||
- name: Decide which branch to use | ||
run: | | ||
case "$TAG" in | ||
v5-09-59*) echo branch=master ;; | ||
*) echo "branch=$(echo "$TAG-patches" | sed -r 's/[a-z]+-01-patches$/-01-patches/')" ;; | ||
esac >> "$GITHUB_OUTPUT" | ||
id: decide_release_branch | ||
env: | ||
TAG: ${{ github.event.inputs.tag }} | ||
|
||
- name: Install Kerberos | ||
run: | | ||
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y krb5-user | ||
cat << \EOF > krb5.conf | ||
${{secrets.KRB5CONF}} | ||
EOF | ||
grep rdns krb5.conf | ||
sudo mv -f krb5.conf /etc/krb5.conf | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: "master" | ||
|
||
- name: Trigger release in jenkins | ||
run: | | ||
set -x | ||
echo ${{secrets.JENKINS_BOT_PASS}} | kinit ${{secrets.PRINCIPAL}} | ||
curl -X POST -k --negotiate -u : ${{secrets.API_URL}} -H 'Content-Type: application/x-www-form-urlencoded' \ | ||
-d 'ALIDIST_SLUG=alisw/alidist@AliPhysics-${{github.event.inputs.tag}}' | ||
klist | ||
kdestroy | ||
- name: Tag and create release | ||
uses: alisw/release-action@v1 | ||
with: | ||
name: ${{ github.event.inputs.tag }} | ||
# The tag is created from the given commit if it does not exist yet. | ||
tag: ${{ github.event.inputs.tag }} | ||
commit: ${{ steps.decide_release_branch.outputs.branch }} | ||
draft: false | ||
prerelease: false | ||
# GitHub often chooses the wrong tag to compare against for | ||
# generating release notes -- it'll generate a diff e.g. between | ||
# v5-09-56-patches and master. | ||
generateReleaseNotes: false |