|
| 1 | + - name: Login to Docker Hub |
| 2 | + uses: docker/login-action@v2 |
| 3 | + with: |
| 4 | + username: ${{ secrets.DOCKER_USER }} |
| 5 | + password: ${{ secrets.DOCKER_PASS }} |
| 6 | + |
| 7 | + - name: Rebuild and push Docker image |
| 8 | + uses: docker/build-push-action@v3 |
| 9 | + with: |
| 10 | + file: ${{ matrix.component }}/Dockerfile |
| 11 | + tags: opencue/${{ matrix.component }}:${{ env.BUILD_ID }},opencue/${{ matrix.component }}:latest |
| 12 | + context: . |
| 13 | + push: true |
| 14 | + |
| 15 | + # This step has been failing with permission issues. |
| 16 | + # Commenting this out temporarily to unblock the release of v1.4 |
| 17 | + # - name: Docker Hub Description |
| 18 | + # uses: peter-evans/dockerhub-description@v4 |
| 19 | + # with: |
| 20 | + # username: ${{ secrets.DOCKER_USER }} |
| 21 | + # password: ${{ secrets.DOCKER_PASS }} |
| 22 | + # repository: opencue/${{ matrix.component }} |
| 23 | + # readme-filepath: ./${{ matrix.component }}/README.md |
| 24 | + |
| 25 | + |
| 26 | + create_release: |
| 27 | + needs: preflight |
| 28 | + name: Create Release |
| 29 | + runs-on: ubuntu-22.04 |
| 30 | + steps: |
| 31 | + - name: Checkout code |
| 32 | + uses: actions/checkout@v4 |
| 33 | + with: |
| 34 | + fetch-depth: 0 |
| 35 | + |
| 36 | + - name: Configure AWS credentials |
| 37 | + uses: aws-actions/configure-aws-credentials@v1 |
| 38 | + with: |
| 39 | + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} |
| 40 | + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
| 41 | + aws-region: ${{ secrets.S3_REGION }} |
| 42 | + role-to-assume: ${{ secrets.AWS_S3_ROLE }} |
| 43 | + role-duration-seconds: 1800 |
| 44 | + |
| 45 | + - name: Set build ID |
| 46 | + run: | |
| 47 | + set -e |
| 48 | + ci/generate_version_number.sh > VERSION |
| 49 | + echo "Build ID: $(cat ./VERSION)" |
| 50 | + echo "BUILD_ID=$(cat ./VERSION)" >> ${GITHUB_ENV} |
| 51 | + |
| 52 | + - name: Fetch artifacts |
| 53 | + id: fetch_artifacts |
| 54 | + env: |
| 55 | + S3_BUCKET: ${{ secrets.S3_BUCKET }} |
| 56 | + run: | |
| 57 | + mkdir -p "${GITHUB_WORKSPACE}/artifacts/" |
| 58 | + aws s3 sync "s3://${S3_BUCKET}/opencue/${BUILD_ID}/" "${GITHUB_WORKSPACE}/artifacts/" |
| 59 | + echo "filenames=$(ls "${GITHUB_WORKSPACE}/artifacts/" | xargs)" >> ${GITHUB_OUTPUT} |
| 60 | + |
| 61 | + - name: List artifacts |
| 62 | + run: | |
| 63 | + echo ${{ steps.fetch_artifacts.outputs.filenames }} |
| 64 | + |
| 65 | + - name: Generate release notes |
| 66 | + id: release_notes |
| 67 | + run: | |
| 68 | + last_tagged_version=$(git describe --tags --abbrev=0 $(git rev-list --tags --skip=1 --max-count=1)) |
| 69 | + commits_since_last_release=$(git log --reverse --pretty="* %H %s" ${last_tagged_version}..HEAD) |
| 70 | + # Use a delimiter to preserve the multiline string. |
| 71 | + # See https://github.community/t/set-output-truncates-multiline-strings/16852 |
| 72 | + delimiter="$(openssl rand -hex 8)" |
| 73 | + echo "commits<<${delimiter}" >> ${GITHUB_OUTPUT} |
| 74 | + echo "${commits_since_last_release}" >> ${GITHUB_OUTPUT} |
| 75 | + echo "${delimiter}" >> ${GITHUB_OUTPUT} |
| 76 | + |
| 77 | + - name: Create release |
| 78 | + id: create_release |
| 79 | + uses: actions/create-release@v1 |
| 80 | + env: |
| 81 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 82 | + with: |
| 83 | + tag_name: v${{ env.BUILD_ID }} |
| 84 | + release_name: v${{ env.BUILD_ID }} |
| 85 | + body: | |
| 86 | + To learn how to install and configure OpenCue, see our [Getting Started guide](https://www.opencue.io/docs/getting-started/). |
| 87 | + |
| 88 | + ## Changes: |
| 89 | + |
| 90 | + ${{ steps.release_notes.outputs.commits }} |
| 91 | + draft: true |
| 92 | + prerelease: false |
| 93 | + |
| 94 | + - name: Upload License |
| 95 | + uses: actions/upload-release-asset@v1 |
| 96 | + env: |
| 97 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 98 | + with: |
| 99 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 100 | + asset_path: ${{ github.workspace }}/artifacts/LICENSE |
| 101 | + asset_name: LICENSE |
| 102 | + asset_content_type: application/octet-stream |
| 103 | + |
| 104 | + - name: Upload Database Schema |
| 105 | + uses: actions/upload-release-asset@v1 |
| 106 | + env: |
| 107 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 108 | + with: |
| 109 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 110 | + asset_path: ${{ github.workspace }}/artifacts/schema-${{ env.BUILD_ID }}.sql |
| 111 | + asset_name: schema-${{ env.BUILD_ID }}.sql |
| 112 | + asset_content_type: application/octet-stream |
| 113 | + |
| 114 | + - name: Upload Demo Data |
| 115 | + uses: actions/upload-release-asset@v1 |
| 116 | + env: |
| 117 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 118 | + with: |
| 119 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 120 | + asset_path: ${{ github.workspace }}/artifacts/seed_data-${{ env.BUILD_ID }}.sql |
| 121 | + asset_name: seed_data-${{ env.BUILD_ID }}.sql |
| 122 | + asset_content_type: application/octet-stream |
| 123 | + |
| 124 | + - name: Upload Cuebot JAR |
| 125 | + uses: actions/upload-release-asset@v1 |
| 126 | + env: |
| 127 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 128 | + with: |
| 129 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 130 | + asset_path: ${{ github.workspace }}/artifacts/cuebot-${{ env.BUILD_ID }}-all.jar |
| 131 | + asset_name: cuebot-${{ env.BUILD_ID }}-all.jar |
| 132 | + asset_content_type: application/octet-stream |
| 133 | + |
| 134 | + - name: Upload Cuebot RPM |
| 135 | + uses: actions/upload-release-asset@v1 |
| 136 | + env: |
| 137 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 138 | + with: |
| 139 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 140 | + asset_path: ${{ github.workspace }}/artifacts/opencue-cuebot-${{ env.BUILD_ID }}-1.noarch.rpm |
| 141 | + asset_name: opencue-cuebot-${{ env.BUILD_ID }}-1.noarch.rpm |
| 142 | + asset_content_type: application/octet-stream |
| 143 | + |
| 144 | + - name: Upload RQD Tar |
| 145 | + uses: actions/upload-release-asset@v1 |
| 146 | + env: |
| 147 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 148 | + with: |
| 149 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 150 | + asset_path: ${{ github.workspace }}/artifacts/rqd-${{ env.BUILD_ID }}-all.tar.gz |
| 151 | + asset_name: rqd-${{ env.BUILD_ID }}-all.tar.gz |
| 152 | + asset_content_type: application/octet-stream |
| 153 | + |
| 154 | + - name: Upload CueGUI Tar |
| 155 | + uses: actions/upload-release-asset@v1 |
| 156 | + env: |
| 157 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 158 | + with: |
| 159 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 160 | + asset_path: ${{ github.workspace }}/artifacts/cuegui-${{ env.BUILD_ID }}-all.tar.gz |
| 161 | + asset_name: cuegui-${{ env.BUILD_ID }}-all.tar.gz |
| 162 | + asset_content_type: application/octet-stream |
| 163 | + |
| 164 | + - name: Upload PyCue Tar |
| 165 | + uses: actions/upload-release-asset@v1 |
| 166 | + env: |
| 167 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 168 | + with: |
| 169 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 170 | + asset_path: ${{ github.workspace }}/artifacts/pycue-${{ env.BUILD_ID }}-all.tar.gz |
| 171 | + asset_name: pycue-${{ env.BUILD_ID }}-all.tar.gz |
| 172 | + asset_content_type: application/octet-stream |
| 173 | + |
| 174 | + - name: Upload PyOutline Tar |
| 175 | + uses: actions/upload-release-asset@v1 |
| 176 | + env: |
| 177 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 178 | + with: |
| 179 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 180 | + asset_path: ${{ github.workspace }}/artifacts/pyoutline-${{ env.BUILD_ID }}-all.tar.gz |
| 181 | + asset_name: pyoutline-${{ env.BUILD_ID }}-all.tar.gz |
| 182 | + asset_content_type: application/octet-stream |
| 183 | + |
| 184 | + - name: Upload CueSubmit Tar |
| 185 | + uses: actions/upload-release-asset@v1 |
| 186 | + env: |
| 187 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 188 | + with: |
| 189 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 190 | + asset_path: ${{ github.workspace }}/artifacts/cuesubmit-${{ env.BUILD_ID }}-all.tar.gz |
| 191 | + asset_name: cuesubmit-${{ env.BUILD_ID }}-all.tar.gz |
| 192 | + asset_content_type: application/octet-stream |
| 193 | + |
| 194 | + - name: Upload CueAdmin Tar |
| 195 | + uses: actions/upload-release-asset@v1 |
| 196 | + env: |
| 197 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 198 | + with: |
| 199 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 200 | + asset_path: ${{ github.workspace }}/artifacts/cueadmin-${{ env.BUILD_ID }}-all.tar.gz |
| 201 | + asset_name: cueadmin-${{ env.BUILD_ID }}-all.tar.gz |
| 202 | + asset_content_type: application/octet-stream |
0 commit comments