Merge branch 'refs/heads/upstream-HEAD' into repo-HEAD #115
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: Debian Release Workflow | |
on: | |
push: | |
branches: [master, 6.0/stage, 6.0/release] | |
tags: | |
- 'release/*' | |
jobs: | |
deb-build-test-release: | |
name: Debian Package Build-Test-Release | |
runs-on: ubuntu-18.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Setup Python | |
uses: actions/setup-python@v1 | |
with: | |
python-version: '3.6' | |
- name: Detect Branch & Set Environment Variables | |
run: | | |
echo "Working with: ${{ github.ref }}" | |
# | |
# Normalized names are mapped like the following examples: | |
# "refs/head/master" -> "master" | |
# "refs/head/6.0/stage" -> "6-0_stage" | |
# "refs/head/release/6.0.1.0" -> "release_6-0-1-0" | |
# | |
gh_branch_name=$(echo "${{ github.ref }}" | cut -d / -f 3- ) | |
echo "GH_BRANCH_NAME=$gh_branch_name" >> $GITHUB_ENV | |
norm_branch_name=$(echo $gh_branch_name | tr /. _- ) | |
deb_file=libkdumpfile_${norm_branch_name}.deb | |
echo "DEBIAN_FILE=$deb_file" >> $GITHUB_ENV | |
ddeb_file=libkdumpfile-dbgsym_${norm_branch_name}.ddeb | |
echo "DEBUG_DEBIAN_FILE=$ddeb_file" >> $GITHUB_ENV | |
# | |
# We create a separate tag, even for the Delphix release | |
# tags, to avoid touching any of the original references | |
# of our github history. (see later comment about Github | |
# releases needing a corresponding tag to be linked with). | |
# | |
gh_release_tag=github_${norm_branch_name} | |
echo "RELEASE_TAG=$gh_release_tag" >> $GITHUB_ENV | |
- name: Install dependencies | |
run: ./.github/scripts/install-deps.sh | |
- name: Perform build and generate package | |
run: ./.github/scripts/build-pkg.sh | |
- name: Install package | |
run: ./.github/scripts/install-pkg.sh | |
- name: Run external testing | |
run: ./.github/scripts/run-external-testing.sh | |
- name: Print generated artifacts | |
run: ls -lh .. | |
- name: Normalize binary package name and path | |
run: mv $(ls ../libkdumpfile_*deb) ${{ env.DEBIAN_FILE }} | |
- name: Normalize debug package name and path | |
run: mv $(ls ../libkdumpfile-dbgsym_*ddeb) ${{ env.DEBUG_DEBIAN_FILE }} | |
- name: Delete previous release and recreate its associated tag | |
# | |
# Github releases always need a corresponding tag attached to them. | |
# Creating a tag for every push to these branches will pollute our | |
# release tags. This is why we always recycle (e.g. delete+recreate) | |
# the same tag for every push. Similarly, we recycle Github releases | |
# as Github won't allow us to create two releases with the same name. | |
# | |
run: | | |
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1 | |
bin/hub release delete ${{ env.RELEASE_TAG }} || echo " release '${{ env.RELEASE_TAG }}' doesn't exist..." | |
bin/hub api -X DELETE repos/${{ github.repository }}/git/refs/tags/${{ env.RELEASE_TAG }} || echo " tag '${{ env.RELEASE_TAG }}' doesn't exist" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ env.RELEASE_TAG }} | |
release_name: Latest ${{ env.GH_BRANCH_NAME }} | |
draft: false | |
prerelease: false | |
- name: Upload debian package | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./${{ env.DEBIAN_FILE }} | |
asset_name: ${{ env.DEBIAN_FILE }} | |
asset_content_type: application/vnd.debian.binary-package | |
- name: Upload debian debug package | |
id: upload-release-asset-2 | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./${{ env.DEBUG_DEBIAN_FILE }} | |
asset_name: ${{ env.DEBUG_DEBIAN_FILE }} | |
asset_content_type: application/vnd.debian.binary-package |