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

Release/Tag Workflow followup fixes #256

Merged
merged 1 commit into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
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
14 changes: 8 additions & 6 deletions .github/workflows/tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,20 @@ jobs:
- name: Get Version
id: get-version
run: |
CURRENT_VERSION=$(awk -F'"' '/ID string =/ {print $2}' ${{ env.VERSION_FILE }})
echo "VERSION=$CURRENT_VERSION" >> "$GITHUB_OUTPUT"
VERSION=$(awk -F'"' '/ID string =/ {print $2}' ${{ env.VERSION_FILE }})
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
- name: Create Tag
if: ${{ steps.get-version.outputs.VERSION != '' }}
run: |
if [ $(git tag -l "${{ steps.get-version.outputs.VERSION }}") ]; then
echo "Tag already exists for version $CURRENT_VERSION"
VERSION=${{ steps.get-version.outputs.VERSION }}
if [ $(git tag -l "$VERSION") ]; then
echo "Tag already exists for version $VERSION"
exit 0
else
git config --global tag.gpgsign true
Copy link
Member Author

@egibs egibs Jun 9, 2024

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Opened a PR to add git config --global tag.gpgsign true to the Action: chainguard-dev/actions#442

git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git tag $CURRENT_VERSION
git push --tags
git tag $VERSION
git push origin tag $VERSION
gitsign verify $(git rev-list --tags --max-count=1) --certificate-identity-regexp="https://github.com/${{ github.repository }}" --certificate-oidc-issuer="https://token.actions.githubusercontent.com"
fi
10 changes: 7 additions & 3 deletions .github/workflows/version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,20 @@ jobs:
exit 1
;;
esac

echo "Current bincapz version: $CURRENT_VERSION"
echo "New bincapz version: $VERSION"

sed -i'' -e "s/ID string = \"v[0-9]*\.[0-9]*\.[0-9]*\"/ID string = \"v$VERSION\"/" ${{ env.VERSION_FILE }}
sed -i -e "s/ID string = \"v[0-9]*\.[0-9]*\.[0-9]*\"/ID string = \"v$VERSION\"/" ${{ env.VERSION_FILE }}
- name: Commit Version Update
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git checkout -b bincapz-version-bump-$VERSION
BRANCH="bincapz-version-bump-$VERSION"
git checkout -b $BRANCH
git add ${{ env.VERSION_FILE }}
git commit -m "Bump bincapz version to v$VERSION"
git push origin bincapz-bump-version-$VERSION
git push origin $BRANCH
gitsign verify $(git rev-parse HEAD) --certificate-identity-regexp="https://github.com/${{ github.repository }}" --certificate-oidc-issuer="https://token.actions.githubusercontent.com"
- name: Create Pull Request
run: |
Expand Down