# How we deploy a release. Covers binary builds. Also manages packaging for choco. name: deployment on: workflow_dispatch: inputs: tag: description: "Which tag to deploy as:" required: true push: tags: - "[0-9]+.[0-9]+.[0-9]+" permissions: {} env: CARGO_INCREMENTAL: 0 CARGO_PROFILE_DEV_DEBUG: 0 CARGO_HUSKY_DONT_INSTALL_HOOKS: true jobs: initialize: name: initialize runs-on: ubuntu-24.04 outputs: version: ${{ env.VERSION }} steps: - name: Get the release version from the tag if: env.VERSION == '' run: | if [[ -n "${GITHUB_EVENT_INPUTS_TAG}" ]]; then echo "Manual run against a tag; overriding actual tag in the environment..." echo "VERSION=${GITHUB_EVENT_INPUTS_TAG}" >> $GITHUB_ENV else echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV fi env: GITHUB_EVENT_INPUTS_TAG: ${{ github.event.inputs.tag }} - name: Validate version environment variable run: | echo "Version being built against is version ${VERSION}"! build-release: needs: [initialize] permissions: id-token: write contents: read attestations: write uses: ./.github/workflows/build_releases.yml with: caller: "deployment" secrets: inherit generate-choco: needs: [initialize, build-release] name: "Generate Chocolatey files" runs-on: ubuntu-24.04 steps: - name: Checkout repository uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: fetch-depth: 1 persist-credentials: false - name: Set release version shell: bash run: | echo "RELEASE_VERSION=${NEEDS_INITIALIZE_OUTPUTS_VERSION}" >> $GITHUB_ENV env: NEEDS_INITIALIZE_OUTPUTS_VERSION: ${{ needs.initialize.outputs.version }} - name: Validate release version run: | echo "Release version: ${RELEASE_VERSION}" - name: Get release artifacts uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: pattern: release-* path: release merge-multiple: true - name: Execute choco packaging script run: | python "./scripts/windows/choco/choco_packager.py" "./release/bottom_x86_64-pc-windows-msvc.zip" ${RELEASE_VERSION} "./scripts/windows/choco/bottom.nuspec.template" "./scripts/windows/choco/chocolateyinstall.ps1.template" "bottom.nuspec" "tools/chocolateyinstall.ps1" "tools/" zip -r choco.zip "bottom.nuspec" "tools" - name: Move release file into release directory shell: bash run: mv choco.zip release/ - name: Save release as artifact uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 with: retention-days: 3 name: release-choco path: release upload-release: name: upload-release runs-on: ubuntu-24.04 needs: [initialize, generate-choco, build-release] environment: production permissions: contents: write steps: - name: Set release version shell: bash run: | echo "RELEASE_VERSION=${NEEDS_INITIALIZE_OUTPUTS_VERSION}" >> $GITHUB_ENV env: NEEDS_INITIALIZE_OUTPUTS_VERSION: ${{ needs.initialize.outputs.version }} - name: Validate release version run: | echo "Release version: ${RELEASE_VERSION}" - name: Checkout repository uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: fetch-depth: 1 persist-credentials: false - name: Get release artifacts uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: pattern: release-* path: release merge-multiple: true - name: Print out all release files run: | echo "Generated $(ls ./release | wc -l) files:" du -h -d 0 ./release/* - name: Create release with files run: | gh release create "${RELEASE_VERSION}" ./release/* --title "${RELEASE_VERSION} Release" --notes-file ./.github/ci/release_notes.md --draft --generate-notes --fail-on-no-commits env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}