Night build #1184
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
name: Night build | |
on: | |
schedule: | |
- cron: '0 6 * * *' # run at 6 AM UTC | |
push: | |
branches: | |
- nigth_build | |
workflow_dispatch: | |
jobs: | |
nightly: | |
name: Night build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
with: | |
ref: nigth_build | |
- name: Set up JDK | |
uses: actions/[email protected] | |
with: | |
java-version: 17 | |
distribution: 'adopt' | |
- name: Build with Gradle | |
run: ./gradlew build | |
- name: Save file name | |
run: echo "PLUGIN_FILE_NAME=$(ls -t ./build/libs | head -1)" >> $GITHUB_ENV | |
- name: Save current date | |
run: echo "PLUGIN_CURRENT_DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV | |
- name: Deploy build | |
uses: WebFreak001/[email protected] | |
with: | |
upload_url: https://uploads.github.com/repos/1c-syntax/sonar-bsl-plugin-community/releases/51033599/assets{?name,label} # find out this value by opening https://api.github.com/repos/<owner>/<repo>/releases in your browser and copy the full "upload_url" value including the {?name,label} part | |
release_id: 51033599 # same as above (id can just be taken out the upload_url, it's used to find old releases) | |
asset_path: ./build/libs/${{ env.PLUGIN_FILE_NAME }} # path to archive to upload | |
asset_name: sonar-communitybsl-plugin-nightly-${{ env.PLUGIN_CURRENT_DATE }}.jar # name, format is "-nightly-20210101" | |
asset_content_type: application/java-archive # required by GitHub API | |
max_releases: 7 # optional, if there are more releases than this matching the asset_name, the oldest ones are going to be deleted |