diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1815c53..25f1a1d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,8 +6,6 @@ on: branches: - main pull_request: {} - schedule: - - cron: '0 0 * * 0' jobs: build: @@ -25,14 +23,9 @@ jobs: - name: Verify no unstaged changes run: ./script/verify-no-unstaged-changes.sh - publish: - if: github.event_name != 'pull_request' - needs: [build] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - - name: Build - run: | - ./script/build.sh - echo ${{ github.sha }} > ./_layout/SHA1 + - name: Release + if: github.event_name == 'workflow_dispatch' + run: | + gh release create v${{github.sha}} --generate-notes ./_layout/action_cache.zip ./_layout/action_cache.tar.gz + env: + GH_TOKEN: ${{ github.token }} diff --git a/.gitignore b/.gitignore index 0cdb7bd..9422b1b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ _layout +_layout_zipball +_layout_tarball _temp \ No newline at end of file diff --git a/config/actions/actions_setup-go.json b/config/actions/actions_setup-go.json index ab380e9..acd30c1 100644 --- a/config/actions/actions_setup-go.json +++ b/config/actions/actions_setup-go.json @@ -6,7 +6,7 @@ "+^v[0-9]+(\\.[0-9]+){0,2}$" ], "branches": { - "main": "883490dfd06f396ebe0b738bc313a53cf9d851e5" + "main": "bfd2fb341f32be7281829126376a12a780ca79fc" }, "defaultBranch": "main", "tags": { diff --git a/script/build.sh b/script/build.sh index 84b57c7..7cef7b3 100755 --- a/script/build.sh +++ b/script/build.sh @@ -85,8 +85,34 @@ done popd # List the repositories -cd $layout_dir +pushd "$layout_dir" echo 'Created repos:' for repo in ./*; do echo "$PWD/$repo" done +popd + +# Split the layout into zip vs. tar.gz +zipball_layout_dir="$script_dir/../_layout_zipball" +rm -rf "$zipball_layout_dir" +tarball_layout_dir="$script_dir/../_layout_tarball" +rm -rf "$tarball_layout_dir" + +cp -r "$layout_dir" "$zipball_layout_dir" +pushd "$zipball_layout_dir" +find . -type f -name "*.tar.gz" -delete +ls -l -R ./ +echo "Creating action_cache_zipball in ${zipball_layout_dir}" +pwsh -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "Compress-Archive -Path \"${zipball_layout_dir}\" -DestinationPath \"${layout_dir}\action_cache.zip\"" +popd + +cp -r "$layout_dir" "$tarball_layout_dir" +pushd "$tarball_layout_dir" +find . -type f -name "*.zip" -delete +ls -l -R ./ +echo "Creating action_cache.tar.gz in ${tarball_layout_dir}" +pushd "$layout_dir" +tar -czf "action_cache.tar.gz" -C "${tarball_layout_dir}" . +popd +popd + diff --git a/script/create-pull-request.sh b/script/create-pull-request.sh index ec27ee1..71d3928 100755 --- a/script/create-pull-request.sh +++ b/script/create-pull-request.sh @@ -23,7 +23,7 @@ git push --set-upstream origin "$branch" # Open pull request url="https://api.github.com/repos/$GITHUB_REPOSITORY/pulls" # GITHUB_REPOSITORY format is: OWNER/REPO -body="{\"title\": \"$branch\", \"body\": \"$branch\", \"head\": \"$branch\", \"base\": \"master\"}" +body="{\"title\": \"$branch\", \"body\": \"$branch\", \"head\": \"$branch\", \"base\": \"main\"}" http_code="$(curl --silent --output response.json --write-out '%{http_code}' --header "Authorization: bearer $GITHUB_TOKEN" --request POST --data "$body" "$url")" if [[ "$http_code" != "201" ]]; then echo "Unexpected HTTP CODE '$http_code'" diff --git a/script/generated/actions_setup-go.sh b/script/generated/actions_setup-go.sh index 7648e1b..ad02c34 100644 --- a/script/generated/actions_setup-go.sh +++ b/script/generated/actions_setup-go.sh @@ -1,7 +1,7 @@ mkdir actions_setup-go pushd actions_setup-go -curl -s -S -L -o '883490dfd06f396ebe0b738bc313a53cf9d851e5.tar.gz' 'https://api.github.com/repos/actions/setup-go/tarball/883490dfd06f396ebe0b738bc313a53cf9d851e5' -curl -s -S -L -o '883490dfd06f396ebe0b738bc313a53cf9d851e5.zip' 'https://api.github.com/repos/actions/setup-go/zipball/883490dfd06f396ebe0b738bc313a53cf9d851e5' +curl -s -S -L -o 'bfd2fb341f32be7281829126376a12a780ca79fc.tar.gz' 'https://api.github.com/repos/actions/setup-go/tarball/bfd2fb341f32be7281829126376a12a780ca79fc' +curl -s -S -L -o 'bfd2fb341f32be7281829126376a12a780ca79fc.zip' 'https://api.github.com/repos/actions/setup-go/zipball/bfd2fb341f32be7281829126376a12a780ca79fc' curl -s -S -L -o '77b162d042858409656f087cab0246511e670694.tar.gz' 'https://api.github.com/repos/actions/setup-go/tarball/77b162d042858409656f087cab0246511e670694' curl -s -S -L -o '77b162d042858409656f087cab0246511e670694.zip' 'https://api.github.com/repos/actions/setup-go/zipball/77b162d042858409656f087cab0246511e670694' curl -s -S -L -o '58fca98f91e83c6442c09dc7175251c60ee9877c.tar.gz' 'https://api.github.com/repos/actions/setup-go/tarball/58fca98f91e83c6442c09dc7175251c60ee9877c'