Skip to content

Commit

Permalink
Fix release scripts (#133)
Browse files Browse the repository at this point in the history
* Fix test code

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Detach before tagging

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Fix test

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Fix test

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Use annotated tag

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>

* Use global config

Signed-off-by: Kenji Miyake <kenji.miyake@tier4.jp>
  • Loading branch information
kenji-miyake authored Jun 4, 2021
1 parent 508fef5 commit 3131637
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 30 deletions.
58 changes: 29 additions & 29 deletions .github/workflows/test-release-scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ jobs:
- name: Commit autoware.proj.repos to remove workspace diff
run: |
git add autoware.proj.repos
git config --local user.email "actions@example.com"
git config --local user.name "Github Actions"
git config --global user.email "actions@example.com"
git config --global user.name "Github Actions"
git commit -m "Update autoware.proj.repos in CI"
- name: Set git config for private repositories
Expand All @@ -106,9 +106,9 @@ jobs:
- name: Check result
run: |
git branch --show-current | grep rc/v0.0.0 || false
cat autoware.proj.repos | grep autoware/autoware.iv -A3 | grep rc/v0.0.0 || false
cat autoware.proj.repos | grep autoware/launcher -A3 | grep rc/v0.0.0 || false
git branch --show-current | grep "^rc/v0.0.0" || false
cat autoware.proj.repos | grep autoware/autoware.iv -A3 | grep "version: rc/v0.0.0" || false
cat autoware.proj.repos | grep autoware/launcher -A3 | grep "version: rc/v0.0.0" || false
- name: Create release tags
run: |
Expand All @@ -124,9 +124,9 @@ jobs:
- name: Check result
run: |
test "$(git branch --show-current)" = "" || false
git describe --tags | grep v0.0.0 || false
cat autoware.proj.repos | grep autoware/autoware.iv -A3 | grep v0.0.0 || false
cat autoware.proj.repos | grep autoware/launcher -A3 | grep v0.0.0 || false
git describe --tags | grep "^v0.0.0" || false
cat autoware.proj.repos | grep autoware/autoware.iv -A3 | grep "version: v0.0.0" || false
cat autoware.proj.repos | grep autoware/launcher -A3 | grep "version: v0.0.0" || false
test-product-release:
needs: vcs-import-cache
Expand Down Expand Up @@ -165,8 +165,8 @@ jobs:
- name: Commit autoware.proj.repos to remove workspace diff
run: |
git add autoware.proj.repos
git config --local user.email "actions@example.com"
git config --local user.name "Github Actions"
git config --global user.email "actions@example.com"
git config --global user.name "Github Actions"
git commit -m "Update autoware.proj.repos in CI"
- name: Set git config for private repositories
Expand All @@ -186,9 +186,9 @@ jobs:
- name: Check result
run: |
git branch --show-current | grep rc/v0.0.1 || false
cat autoware.proj.repos | grep autoware/autoware.iv -A3 | grep rc/v0.0.0 || false
cat autoware.proj.repos | grep autoware/launcher -A3 | grep rc/v0.0.1 || false
git branch --show-current | grep "^rc/v0.0.1" || false
cat autoware.proj.repos | grep autoware/autoware.iv -A3 | grep "version: rc/v0.0.0" || false
cat autoware.proj.repos | grep autoware/launcher -A3 | grep "version: rc/v0.0.1" || false
- name: Create release tags
run: |
Expand All @@ -204,9 +204,9 @@ jobs:
- name: Check result
run: |
test "$(git branch --show-current)" = "" || false
git describe --tags | grep v0.0.1 || false
cat autoware.proj.repos | grep autoware/autoware.iv -A3 | grep v0.0.0 || false
cat autoware.proj.repos | grep autoware/launcher -A3 | grep v0.0.1 || false
git describe --tags | grep "^v0.0.1" || false
cat autoware.proj.repos | grep autoware/autoware.iv -A3 | grep "version: v0.0.0" || false
cat autoware.proj.repos | grep autoware/launcher -A3 | grep "version: v0.0.1" || false
test-product-release-after-reference-release:
needs: vcs-import-cache
Expand Down Expand Up @@ -245,8 +245,8 @@ jobs:
- name: Commit autoware.proj.repos to remove workspace diff
run: |
git add autoware.proj.repos
git config --local user.email "actions@example.com"
git config --local user.name "Github Actions"
git config --global user.email "actions@example.com"
git config --global user.name "Github Actions"
git commit -m "Update autoware.proj.repos in CI"
- name: Set git config for private repositories
Expand All @@ -271,9 +271,9 @@ jobs:
- name: Check result
run: |
git branch --show-current | grep rc/v0.0.1 || false
cat autoware.proj.repos | grep autoware/autoware.iv -A3 | grep v0.0.0 || false
cat autoware.proj.repos | grep autoware/launcher -A3 | grep rc/v0.0.1 || false
git branch --show-current | grep "^rc/v0.0.1" || false
cat autoware.proj.repos | grep autoware/autoware.iv -A3 | grep "version: v0.0.0" || false
cat autoware.proj.repos | grep autoware/launcher -A3 | grep "version: rc/v0.0.1" || false
- name: Create release tags
run: |
Expand All @@ -289,9 +289,9 @@ jobs:
- name: Check result
run: |
test "$(git branch --show-current)" = "" || false
git describe --tags | grep v0.0.1 || false
cat autoware.proj.repos | grep autoware/autoware.iv -A3 | grep v0.0.0 || false
cat autoware.proj.repos | grep autoware/launcher -A3 | grep v0.0.1 || false
git describe --tags | grep "^v0.0.1" || false
cat autoware.proj.repos | grep autoware/autoware.iv -A3 | grep "version: v0.0.0" || false
cat autoware.proj.repos | grep autoware/launcher -A3 | grep "version: v0.0.1" || false
test-experiment-branch:
needs: vcs-import-cache
Expand Down Expand Up @@ -330,8 +330,8 @@ jobs:
- name: Commit autoware.proj.repos to remove workspace diff
run: |
git add autoware.proj.repos
git config --local user.email "actions@example.com"
git config --local user.name "Github Actions"
git config --global user.email "actions@example.com"
git config --global user.name "Github Actions"
git commit -m "Update autoware.proj.repos in CI"
- name: Set git config for private repositories
Expand All @@ -351,6 +351,6 @@ jobs:
- name: Check result
run: |
git branch --show-current | grep experiment/20210123-test || false
cat autoware.proj.repos | grep autoware/autoware.iv -A3 | grep experiment/20210123-test || false
cat autoware.proj.repos | grep autoware/launcher -A3 | grep experiment/20210123-test || false
git branch --show-current | grep "^experiment/20210123-test" || false
cat autoware.proj.repos | grep autoware/autoware.iv -A3 | grep "version: experiment/20210123-test" || false
cat autoware.proj.repos | grep autoware/launcher -A3 | grep "version: experiment/20210123-test" || false
3 changes: 2 additions & 1 deletion scripts/release/common/helper_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@ function create_tag() {
fi

echo -e "Create tag \"$version\" in \"$repository\""
$git_command tag "$version" || exit 1
$git_command checkout --detach --quiet HEAD
$git_command tag -a "$version" -m "$version" || exit 1

if [ "$flag_push" ]; then
echo -e "Push tag \"$version\" to \"$repository\""
Expand Down

0 comments on commit 3131637

Please sign in to comment.