Skip to content

Commit

Permalink
Move submodule update to release action
Browse files Browse the repository at this point in the history
  • Loading branch information
dwendland committed Aug 10, 2022
1 parent 943f445 commit 8e767a0
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 34 deletions.
33 changes: 0 additions & 33 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,39 +11,6 @@ on:

jobs:

refresh-modules:
name: Refresh Submodules
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo

- name: Create local changes
run: |
#git pull --recurse-submodules
#git submodule update --remote --recursive
git submodule update --init --recursive
git submodule update --recursive --remote
- name: Commit files
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git commit -m "Update Submodules" -a
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch

- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ steps.extract_branch.outputs.branch }} #${{ github.ref }}

generate-version:
name: Generate version
runs-on: ubuntu-latest
Expand Down
30 changes: 29 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,35 @@ on:

jobs:

refresh-modules:
name: Refresh Submodules
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0 # otherwise, you will failed to push refs to dest repo

- name: Create local changes
run: |
git submodule update --init --recursive
git submodule update --recursive --remote
- name: Commit files
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git commit -m "New Release: Update Submodules" -a
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main


generate-version:
name: Generate version
runs-on: ubuntu-latest

outputs:
Expand All @@ -34,7 +61,8 @@ jobs:


git-release:
needs: ["generate-version"]
name: Git Release
needs: ["generate-version", "refresh-modules"]
runs-on: ubuntu-latest

steps:
Expand Down

0 comments on commit 8e767a0

Please sign in to comment.