Skip to content

Commit

Permalink
Merge branch 'egibs-release-instead-of-tag'
Browse files Browse the repository at this point in the history
Signed-off-by: egibs <[email protected]>
  • Loading branch information
egibs committed Jun 10, 2024
2 parents 5042389 + b999393 commit 6614d7f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
26 changes: 10 additions & 16 deletions .github/workflows/tag.yaml → .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: Tag Release
name: Cut Release

on:
push:
branches:
- main
workflow_dispatch:

permissions:
id-token: write
Expand All @@ -26,18 +24,14 @@ jobs:
run: |
VERSION=$(awk -F'"' '/ID string =/ {print $2}' ${{ env.VERSION_FILE }})
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
- name: Create Tag
- name: Create Release
env:
GH_TOKEN: ${{ github.token }}
if: ${{ steps.get-version.outputs.VERSION != '' }}
run: |
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
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
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
git config --global tag.gpgsign true
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
gh release create "$VERSION" --title "$VERSION" --notes "Release $VERSION" --draft --generate-notes
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"
7 changes: 6 additions & 1 deletion .github/workflows/version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29
- uses: chainguard-dev/actions/setup-gitsign@e82b4e5ae10182af72972addcb3fedf7454621c8
- name: Update Version
id: update
run: |
UPDATE_TYPE=${{ github.event.inputs.update }}
Expand Down Expand Up @@ -52,16 +53,20 @@ jobs:
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 }}
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Commit Version Update
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
VERSION=${{ steps.update.outputs.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 $BRANCH
gitsign verify $(git rev-parse HEAD) --certificate-identity-regexp="https://github.com/${{ github.repository }}" --certificate-oidc-issuer="https://token.actions.githubusercontent.com"
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
env:
GH_TOKEN: ${{ github.token }}
run: |
gh pr create -t "Update bincapz to $VERSION" -b "PR to update the version in ${{ env.VERSION_FILE }} to $VERSION" -B main

0 comments on commit 6614d7f

Please sign in to comment.