v1.2.0 #4
Workflow file for this run
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: Release | |
on: | |
release: | |
types: | |
- created | |
# Releases need permissions to read and write the repository contents. | |
# GitHub considers creating releases and uploading assets as writing contents. | |
permissions: | |
contents: write | |
env: | |
TAG: ${{ github.event.release.tag_name }} | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
fetch-depth: 0 | |
- name: Install bosh-cli and tile | |
run: | | |
BOSHREL=$(basename $(curl -Ls -o /dev/null -w %{url_effective} https://github.com/cloudfoundry/bosh-cli/releases/latest) | sed s/v//g) | |
curl -sSLo /tmp/bosh https://github.com/cloudfoundry/bosh-cli/releases/latest/download/bosh-cli-${BOSHREL}-linux-amd64 | |
chmod +x /tmp/bosh && sudo mv /tmp/bosh /usr/local/bin/bosh | |
curl -sSLo /tmp/tile https://github.com/cf-platform-eng/tile-generator/releases/latest/download/tile_linux-64bit | |
chmod +x /tmp/tile && sudo mv /tmp/tile /usr/local/bin/tile | |
- name: Download falcon-installer | |
run: | | |
REL=$(basename $(curl -Ls -o /dev/null -w %{url_effective} https://github.com/CrowdStrike/falcon-installer/releases/latest) | sed s/v//g) | |
# Add Linux installer | |
curl -sSLo falcon-installer-linux-x86_64.tar.gz https://github.com/CrowdStrike/falcon-installer/releases/latest/download/falcon-installer-${REL}-linux-x86_64.tar.gz | |
tar -xzf falcon-installer-linux-x86_64.tar.gz -C final_blobs/ | |
chmod +x final_blobs/falcon-installer && rm -f falcon-installer-linux-x86_64.tar.gz | |
bosh add-blob final_blobs/falcon-installer falcon-installer | |
# Add Windows installer | |
curl -sSLo falcon-installer-windows-x86_64.zip https://github.com/CrowdStrike/falcon-installer/releases/latest/download/falcon-installer-${REL}-windows-x86_64.zip | |
unzip -o falcon-installer-windows-x86_64.zip -d final_blobs/ | |
chmod +x final_blobs/falcon-installer.exe && rm -f falcon-installer-windows-x86_64.zip | |
bosh add-blob final_blobs/falcon-installer.exe falcon-installer.exe | |
rm final_blobs/{falcon-installer,falcon-installer.exe,README.md,LICENSE} | |
- name: Set Release Version | |
run: | | |
echo "VERSION=$(echo $TAG | sed s/v//g)" >> $GITHUB_ENV | |
- name: Create bosh release | |
run: | | |
bosh create-release --force --final --tarball=resources/falcon-boshrelease.tgz --version ${VERSION} | |
- name: Create pivotal tile | |
run: | | |
sed "s/^[ ]\+value: [0-9][0-9.]*/ value: $VERSION/g" -i tile.yml | |
tile build ${VERSION} | |
- name: Update release artifacts in GitHub | |
run: | | |
git config user.name github-actions[bot] | |
git config user.email 41898282+github-actions[bot]@users.noreply.github.com | |
git add final_blobs config releases tile.yml tile-history.yml | |
git commit -m "Updating release components for ${TAG}" | |
git push origin HEAD:${{ github.event.release.target_commitish }} | |
git tag -f "${GITHUB_REF#refs/tags/}" | |
git push origin "${GITHUB_REF#refs/tags/}" --force | |
- name: Update artifacts to release | |
run: | | |
gh release upload $TAG resources/falcon-boshrelease.tgz product/*.pivotal | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |