Merge discvr-26.3 to discvr-26.7 #4377
Workflow file for this run
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: Build DISCVR | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - "*" | |
| tags-ignore: | |
| - latest | |
| pull_request: | |
| jobs: | |
| build-modules: | |
| # See: https://help.github.com/en/actions/reference/contexts-and-expression-syntax-for-github-actions#github-context | |
| # https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables#default-environment-variables | |
| if: github.repository == 'BimberLab/DiscvrLabKeyModules' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: "Find default branch" | |
| uses: octokit/request-action@v3.0.0 | |
| id: get_default_branch | |
| with: | |
| route: GET /repos/${{ github.repository }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.PAT }} | |
| - name: "Print default branch" | |
| run: | | |
| DEFAULT_BRANCH='${{ fromJson(steps.get_default_branch.outputs.data).default_branch }}' | |
| echo 'Default branch: '$DEFAULT_BRANCH | |
| echo 'Event: ${{ github.event_name }}' | |
| echo 'Repository: ${{ github.repository }}' | |
| echo "DEFAULT_BRANCH=${DEFAULT_BRANCH}" >> $GITHUB_ENV | |
| id: default-branch | |
| # Note: use slight delay in case there are associated commits across repos | |
| - name: "Sleep for 30 seconds" | |
| run: sleep 30s | |
| shell: bash | |
| - name: "Build DISCVR" | |
| uses: bimberlabinternal/DevOps/githubActions/discvr-build@master | |
| with: | |
| artifactory_user: ${{secrets.artifactory_user}} | |
| artifactory_password: ${{secrets.artifactory_password}} | |
| # NOTE: permissions are limited on the default secrets.GITHUB_TOKEN, including updating workflows, so use a personal access token | |
| github_token: ${{ secrets.PAT }} | |
| env: | |
| # Only generate the distribution if this is the default branch | |
| GENERATE_DIST: ${{ env.DEFAULT_BRANCH == github.ref_name && '1' || '0' }} | |
| - name: Publish Latest Release | |
| id: publish-release | |
| if: ${{ env.DEFAULT_BRANCH == github.ref_name && github.event_name == 'push' && github.base_ref == '' }} | |
| env: | |
| GH_TOKEN: "${{ secrets.PAT }}" | |
| run: | | |
| LK_VERSION=$(cat /home/runner/work/_temp/_github_home/lkDist/release.txt | sed 's/-SNAPSHOT//g') | |
| cd /home/runner/work/_temp/_github_home/labkey_build/${LK_VERSION}/server/server/modules/DiscvrLabKeyModules | |
| COUNT=$(gh release list | grep 'latest' | wc -l) | |
| if [ $COUNT != '0' ];then | |
| echo 'Deleting existing release' | |
| gh release delete 'latest' --cleanup-tag -y; | |
| fi | |
| git push -f origin 'latest' | |
| sleep 100 # gh release periodically fails due to a missing tag. | |
| gh release create 'latest' --verify-tag --generate-notes --prerelease --title "Development Build: ${{ env.DEFAULT_BRANCH }}" | |
| gh release upload 'latest' /home/runner/work/_temp/_github_home/lkDist/discvr/DISCVR-* |