From 6671c227cc62d890434baef6236eca39c02fb52d Mon Sep 17 00:00:00 2001 From: Denis Yuen Date: Tue, 30 May 2023 16:38:30 -0400 Subject: [PATCH] add to develop to allow interaction [skip ci] --- .github/collab-mvn-settings.xml | 9 +++++ .github/workflows/deploy_tagged.yml | 58 +++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 .github/collab-mvn-settings.xml create mode 100644 .github/workflows/deploy_tagged.yml diff --git a/.github/collab-mvn-settings.xml b/.github/collab-mvn-settings.xml new file mode 100644 index 00000000..711bbdc0 --- /dev/null +++ b/.github/collab-mvn-settings.xml @@ -0,0 +1,9 @@ + + + + central + dockstore-bot + ${env.COLLAB_DEPLOY_TOKEN} + + + diff --git a/.github/workflows/deploy_tagged.yml b/.github/workflows/deploy_tagged.yml new file mode 100644 index 00000000..c541d666 --- /dev/null +++ b/.github/workflows/deploy_tagged.yml @@ -0,0 +1,58 @@ +name: Tagged release deploy + +on: + workflow_dispatch: + inputs: + changelist: + description: 'patch and pre-release metadata' + required: true + default: '.0-alpha.1' + + +jobs: + build: + runs-on: ubuntu-22.04 + + # Should only release tags + # TODO: should only release tags where the required status checks are passing + if: startsWith(github.ref, 'refs/tags/') + + permissions: + id-token: write + + steps: + - uses: actions/checkout@v3 + # Step that does that actual cache save and restore + - uses: actions/cache@v3 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + + - name: install git secrets + run: | + wget --no-verbose -O git-secrets-1.3.0.tar.gz https://github.com/awslabs/git-secrets/archive/1.3.0.tar.gz + tar -zxf git-secrets-1.3.0.tar.gz + cd git-secrets-1.3.0 + sudo make install + - name: Set up JDK + uses: actions/setup-java@v3 + with: + java-version: '17.0.4+8' + distribution: 'adopt' + + - name: Store Maven project version + run: echo "maven_project_version=$(mvn help:evaluate -Dexpression=project.version -Dchangelist=${{ github.event.inputs.changelist }} -q -DforceStdout)" >> $GITHUB_ENV + + - name: Read exported variable + run: | + echo "${{ env.maven_project_version }}" + + - name: Deploy with mvnw + run: | + git config --global user.email "${{ github.actor }}" + git config --global user.name "${{ github.actor }}" + ./mvnw --batch-mode deploy -ntp -s .github/collab-mvn-settings.xml -DskipTests -Dchangelist=${{ github.event.inputs.changelist }} + env: + COLLAB_DEPLOY_TOKEN: ${{ secrets.COLLAB_DEPLOY_TOKEN }}