-
Notifications
You must be signed in to change notification settings - Fork 2k
Releases Refactor #2668
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
Merged
Merged
Releases Refactor #2668
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
b21f0a7
Being deployment workflow
MGatner c5d43b9
Add to workflow
MGatner 8df0627
Add deploy scripts, workflow-fu
MGatner 291dd54
Tweak workflow, bugfix script
MGatner 6b31eb2
Add commit identities, update appstarter in yaml
MGatner ed24a56
Improve deploy scripts
MGatner 0d98a64
Restore non-test organization
MGatner 3a080e2
Update builds script for stable
MGatner 2d4017a
Remove legacy release scripts
MGatner 489e624
Update release docs
MGatner 52a7b06
Remove extraneous file
MGatner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| #!/bin/bash | ||
|
|
||
| ## Deploy codeigniter4/appstarter | ||
|
|
||
| # Setup variables | ||
| SOURCE=$1 | ||
| TARGET=$2 | ||
| RELEASE=$3 | ||
|
|
||
| echo "Preparing for version $3" | ||
| echo "Merging files from $1 to $2" | ||
|
|
||
| # Prepare the source | ||
| cd $SOURCE | ||
| git checkout master | ||
|
|
||
| # Prepare the target | ||
| cd $TARGET | ||
| git checkout master | ||
| rm -rf * | ||
|
|
||
| # Copy common files | ||
| releasable='app public writable env license.txt spark .gitignore' | ||
| for fff in $releasable ; do | ||
| cp -Rf ${SOURCE}/$fff ./ | ||
| done | ||
|
|
||
| # Copy repo-specific files | ||
| cp -Rf ${SOURCE}/admin/starter/. ./ | ||
|
|
||
| # Commit the changes | ||
| git add . | ||
| git commit -m "Release ${RELEASE}" | ||
| git push | ||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| #!/bin/bash | ||
|
|
||
| ## Deploy codeigniter4/framework | ||
|
|
||
| # Setup variables | ||
| SOURCE=$1 | ||
| TARGET=$2 | ||
| RELEASE=$3 | ||
|
|
||
| echo "Preparing for version $3" | ||
| echo "Merging files from $1 to $2" | ||
|
|
||
| # Prepare the source | ||
| cd $SOURCE | ||
| git checkout master | ||
|
|
||
| # Prepare the target | ||
| cd $TARGET | ||
| git checkout master | ||
| rm -rf * | ||
|
|
||
| # Copy common files | ||
| releasable='app public writable env license.txt spark .gitignore system' | ||
| for fff in $releasable ; do | ||
| cp -Rf ${SOURCE}/$fff ./ | ||
| done | ||
|
|
||
| # Copy repo-specific files | ||
| cp -Rf ${SOURCE}/admin/framework/. ./ | ||
|
|
||
| # Commit the changes | ||
| git add . | ||
| git commit -m "Release ${RELEASE}" | ||
| git push |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| name: Deploy | ||
|
|
||
| on: | ||
| release: | ||
| types: [published] | ||
|
|
||
| jobs: | ||
| framework: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Identify | ||
| run: | | ||
| git config --global user.email "action@github.com" | ||
| git config --global user.name "${GITHUB_ACTOR}" | ||
|
|
||
| - name: Checkout source | ||
| uses: actions/checkout@v2 | ||
| with: | ||
| path: source | ||
|
|
||
| - name: Checkout target | ||
| uses: actions/checkout@v2 | ||
| with: | ||
| repository: codeigniter4/framework | ||
| token: ${{ secrets.ACCESS_TOKEN }} | ||
| path: framework | ||
|
|
||
| - name: Chmod | ||
| run: chmod +x ./source/.github/scripts/deploy-framework | ||
|
|
||
| - name: Deploy | ||
| run: ./source/.github/scripts/deploy-framework ${GITHUB_WORKSPACE}/source ${GITHUB_WORKSPACE}/framework ${GITHUB_REF##*/} | ||
|
|
||
| - name: Release | ||
| uses: actions/github-script@0.8.0 | ||
| with: | ||
| github-token: ${{secrets.ACCESS_TOKEN}} | ||
| script: | | ||
| const release = await github.repos.getLatestRelease({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo | ||
| }) | ||
| github.repos.createRelease({ | ||
| owner: context.repo.owner, | ||
| repo: 'framework', | ||
| tag_name: release.data.tag_name, | ||
| name: release.data.name, | ||
| body: release.data.body | ||
| }) | ||
|
|
||
| appstarter: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Identify | ||
| run: | | ||
| git config --global user.email "action@github.com" | ||
| git config --global user.name "${GITHUB_ACTOR}" | ||
|
|
||
| - name: Checkout source | ||
| uses: actions/checkout@v2 | ||
| with: | ||
| path: source | ||
|
|
||
| - name: Checkout target | ||
| uses: actions/checkout@v2 | ||
| with: | ||
| repository: codeigniter4/appstarter | ||
| token: ${{ secrets.ACCESS_TOKEN }} | ||
| path: appstarter | ||
|
|
||
| - name: Chmod | ||
| run: chmod +x ./source/.github/scripts/deploy-appstarter | ||
|
|
||
| - name: Deploy | ||
| run: ./source/.github/scripts/deploy-appstarter ${GITHUB_WORKSPACE}/source ${GITHUB_WORKSPACE}/appstarter ${GITHUB_REF##*/} | ||
|
|
||
| - name: Release | ||
| uses: actions/github-script@0.8.0 | ||
| with: | ||
| github-token: ${{secrets.ACCESS_TOKEN}} | ||
| script: | | ||
| const release = await github.repos.getLatestRelease({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo | ||
| }) | ||
| github.repos.createRelease({ | ||
| owner: context.repo.owner, | ||
| repo: 'appstarter', | ||
| tag_name: release.data.tag_name, | ||
| name: release.data.name, | ||
| body: release.data.body | ||
| }) |
This file contains hidden or 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
This file contains hidden or 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
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This command scares me :) Can you explain it is doing. Seems like you checkout master branch then delete everything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way the old script worked it would copy in the chosen files (like we do below) pre-wiping any directories (this was the bugged part from the
cprmtypo). Where that fails is when there are files that are renamed or removed (notice we have license.txt and a duplicate legacy LICENSE because of this). Using the modified version above it checks out the target repo (AppStarter or framework) and rebuilds the repo from scratch (* ignores files with leading periods so it doesn’t affect the.gitdirectory). Also, it’s just a new commit so we could always back up one and nothing is lost!