feat(bootstrapping): automatically rebuild gontainer's deps using the… #24
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
name: Gontainer | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: write | |
jobs: | |
bootstrapping: | |
env: | |
COMMIT_MESSAGE: "${{ github.event.head_commit.message }}" | |
if: ${{ startsWith(github.event.head_commit.message, 'Brew formula update for gontainer version') }} | |
name: Bootstrapping PR | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
go: [ '1.21' ] | |
steps: | |
- run: echo "GONTAINER_VERSION=$(echo $COMMIT_MESSAGE | awk '{print $NF}')" >> $GITHUB_ENV | |
- run: echo "Gontainer $GONTAINER_VERSION" | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
repository: gontainer/gontainer | |
- run: git checkout -B bootstrapping/$GONTAINER_VERSION | |
- run: brew install gontainer/homebrew-tap/gontainer | |
- run: gontainer -v | |
- run: make self-compile | |
- run: 'git config user.name ${{ github.event.pusher.name }}' | |
- run: 'git config user.email ${{ github.event.pusher.email }}' | |
- run: 'git commit -m "feat(bootstrapping): gontainer $GONTAINER_VERSION" internal/gontainer/gontainer.go' | |
# - run: 'git remote set-url --push origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/gontainer/gontainer' | |
# - run: "git push --set-upstream origin bootstrapping/$GONTAINER_VERSION" | |
- name: Create pull request | |
run: 'gh pr create --base=main --fill-first --no-maintainer-edit --head' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |