Nightly Release #140
This file contains hidden or 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
| name: Nightly Release | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "0 2 * * *" # release nightly at 2AM | |
| permissions: | |
| contents: read | |
| jobs: | |
| nightly-release: | |
| name: Nightly Release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/create-github-app-token@7e473efe3cb98aa54f8d4bac15400b15fad77d94 # v2.2.0 | |
| id: otelbot-token | |
| with: | |
| app-id: ${{ vars.OTELBOT_COLLECTOR_RELEASES_APP_ID }} | |
| private-key: ${{ secrets.OTELBOT_COLLECTOR_RELEASES_PRIVATE_KEY }} | |
| permission-contents: write | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ steps.otelbot-token.outputs.token }} | |
| - name: 'Push new tag' | |
| run: | | |
| git config --global user.name "otelbot" | |
| git config --global user.email "[email protected]" | |
| # A previous release was created using a lightweight tag | |
| # git describe by default includes only annotated tags | |
| # git describe --tags includes lightweight tags as well | |
| DESCRIBE=`git tag -l --sort=-v:refname | grep -v cmd | grep -v nightly | head -n 1` # list tags except the ones containing cmd or nightly and then take the latest one | |
| MAJOR_VERSION=`echo $DESCRIBE | awk '{split($0,a,"."); print a[1]}'` # take just the major version digits, e.g. "v0" | |
| MINOR_VERSION=`echo $DESCRIBE | awk '{split($0,a,"."); print a[2]}'` # take just the minor version digits, e.g. "130" | |
| MINOR_VERSION="$((${MINOR_VERSION} + 1))" # bump minor version | |
| TAG="${MAJOR_VERSION}.${MINOR_VERSION}.0-nightly.$(date +'%Y%m%d%H%M')" | |
| git tag -a $TAG -m "$TAG: nightly build" | |
| git push origin $TAG |