-
Notifications
You must be signed in to change notification settings - Fork 246
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(go): runtime release tagging (#2417)
Adds github actions workflows for automatically tagging jsii-runtime-go when jsii release branch is updated. This essentially publishes new runtime version. This may eventually be served better in delivlib but is much simpler in github actions for the alpha phase. Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Romain Marcadier <[email protected]>
- Loading branch information
1 parent
91454df
commit 9ffd204
Showing
3 changed files
with
92 additions
and
97 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -466,3 +466,95 @@ jobs: | |
path: |- | ||
${{ github.workspace }}/aws-cdk/dist/ | ||
${{ github.workspace }}/aws-cdk/**/dist/ | ||
push-go-runtime: | ||
needs: build | ||
if: github.event_name == 'push' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Node 12 | ||
uses: actions/[email protected] | ||
with: | ||
node-version: '12' | ||
- name: Download Artifact | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: built-tree | ||
path: ${{ github.workspace }}/jsii-built-tree | ||
- name: Extract Artifact | ||
working-directory: ${{ github.workspace }}/jsii-built-tree | ||
run: |- | ||
echo "::group::Untar Archive" | ||
tar Jxvf built-tree.tar.xz | ||
echo "::endgroup" | ||
rm built-tree.tar.xz | ||
- name: Get Last Commit Message | ||
id: get-last-commit-msg | ||
working-directory: ${{ github.workspace }}/jsii-built-tree | ||
run: |- | ||
message=$(git log -1 --format=%s) | ||
echo "::set-output name=result::$message" | ||
- name: Locate Caches | ||
id: cache-locations | ||
run: |- | ||
echo "::set-output name=yarn-cache::$(yarn cache dir)" | ||
- name: Cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: |- | ||
${{ steps.cache-locations.outputs.yarn-cache }} | ||
${{ github.workspace }}/node_modules | ||
${{ github.workspace }}/*/*/node_modules | ||
key: ${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: |- | ||
${{ runner.os }}-yarn- | ||
- name: Install Dependencies | ||
working-directory: ${{ github.workspace }}/jsii-built-tree | ||
run: |- | ||
yarn install --frozen-lockfile | ||
- name: Build Runtime Repo Directory | ||
id: build-repo-dir | ||
run: |- | ||
mkdir ${{ github.workspace }}/jsii-runtime-go | ||
repo_dir=${{ github.workspace }}/jsii-runtime-go | ||
echo "::set-output name=repodir::$repo_dir" | ||
- name: Clone Runtime | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: ${{ secrets.JSII_RUNTIME_REPO_NAME }} | ||
ref: 'main' | ||
token: ${{ secrets.AUTO_APPROVE_GITHUB_TOKEN }} | ||
path: ${{ steps.build-repo-dir.outputs.repodir }} | ||
- name: Copy Runtime Files | ||
working-directory: ${{ github.workspace }}/jsii-built-tree/packages/@jsii/go-runtime | ||
run: |- | ||
yarn ts-node ./build-tools/build-repo-dir.ts ${{ steps.build-repo-dir.outputs.repodir }} | ||
- name: Check for changes | ||
id: check-for-changes | ||
working-directory: ${{ steps.build-repo-dir.outputs.repodir }} | ||
run: |- | ||
git fetch --depth=1 --quiet origin main | ||
git add . | ||
# Check for modifications in tracked files | ||
changed=$(git diff --name-only origin/main) | ||
if [-z "$changed"]; then | ||
echo "::set-output name=result::false" | ||
else | ||
echo "::set-output name=result::true" | ||
fi | ||
- name: Commit and Push | ||
if: steps.check-for-changes.outputs.result == 'true' | ||
working-directory: ${{ steps.build-repo-dir.outputs.repodir }} | ||
run: |- | ||
git config user.name "AWS CDK Automation" | ||
git config user.email "[email protected]" | ||
git commit -m "${{ steps.get-last-commit-msg.outputs.result }}" | ||
git push | ||
- name: Tag Release | ||
if: github.ref == 'refs/head/release' | ||
run: |- | ||
VERSION=$(node -e 'console.log(require("./lerna.json").version)') | ||
cd ${{ steps.build-repo-dir.outputs.repodir }} | ||
git tag -a $VERSION -m "v$VERSION" | ||
git push $VERSION |
This file was deleted.
Oops, something went wrong.
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