Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload Jib CLI release archive for JRE and its SHA checksum #2946

Merged
merged 7 commits into from
Dec 21, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 37 additions & 8 deletions .github/workflows/jib-cli-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,44 @@ jobs:
- name: Check out code
uses: actions/checkout@v2

- name: Build Jib CLI
- name: Build project
run: |
if [[ ! "${{ github.event.inputs.release_version }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo 'version "${{ github.event.inputs.release_version }}" not in ###.###.### format'
exit 1
fi
# TODO: run integration test? (Requries auth with GCP.)
./gradlew clean build jib-cli:instDist
./gradlew clean build --stacktrace

- name: Run Gradle release
run: |
git checkout -b cli_release_v${{ github.event.inputs.release_version }}
# TODO: set this to the GitHub user triggering the workflow
git config user.email "chanseok@google.com"
git config user.name "Chanseok Oh"
./gradlew jib-cli:release -Prelease.useAutomaticVersion=true -Prelease.releaseVersion=${{ github.event.inputs.release_version }}
# This creates the tag (e.g., "v0.1.0-cli") and pushes the updated
# branch (e.g., "cli_release_v0.1.0") and the new tag.
./gradlew jib-cli:release \
-Prelease.useAutomaticVersion=true \
-Prelease.releaseVersion=${{ github.event.inputs.release_version }}

- name: Build Jib CLI release binaries
run: |
git checkout v${{ github.event.inputs.release_version }}-cli
./gradlew jib-cli:instDist --stacktrace

cd jib-cli/build/install
zip -rv jib-jre.zip jib
sha256sum jib-jre.zip > jib-jre.zip.sha256

- name: Create pull request
uses: repo-sync/pull-request@v2
with:
# Provided by Actions. No need to create a token.
github_token: ${{ secrets.GITHUB_TOKEN }}
source_branch: cli_release_v${{ github.event.inputs.release_version }}
pr_title: "CLI release v${{ github.event.inputs.release_version }}"
pr_body: "To be merged after the release is complete."

- name: Draft GitHub release
uses: actions/create-release@v1
Expand All @@ -44,13 +64,22 @@ jobs:
release_name: jib-cli v${{ github.event.inputs.release_version }}
draft: true

- name: Upload Jib CLI binaries
- name: Upload Jib CLI
uses: actions/upload-release-asset@v1
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, to upload multiple assets, we need to add multiple steps.

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./jib-cli/build/install/jib-jre.zip
asset_name: jib-jre.zip
asset_content_type: application/zip

- name: Upload Jib CLI checksum
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
# TODO: upload an archive
asset_path: ./jib-cli/build/install/jib/bin/jib
asset_name: jib
asset_content_type: application/octet-stream
asset_path: ./jib-cli/build/install/jib-jre.zip.sha256
asset_name: jib-jre.zip.sha256
asset_content_type: text/plain