-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
54 additions
and
16 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ name: Build and release | |
on: | ||
push: | ||
tags: | ||
- "v*" | ||
- "v*.*.*" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
|
@@ -16,6 +16,47 @@ jobs: | |
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Get the latest tag and date | ||
id: version_info | ||
run: | | ||
echo "tag=$(echo $GITHUB_REF | sed 's/refs\/tags\///')" >> $GITHUB_ENV | ||
echo "date=$(date +"(%d-%m-%Y)")" >> $GITHUB_ENV | ||
- name: Check if WallGoMatrixVersion matches GitHub tag | ||
run: | | ||
WallGoMatrixVersion=$(sed -n 's/WallGoMatrix`\$WallGoMatrixVersion = "\(.*\)";/\1/p' WallGoMatrix.m) | ||
WallGoMatrixVersionDate=$(sed -n 's/WallGoMatrix`\$WallGoMatrixVersionDate = "\(.*\)";/\1/p' WallGoMatrix.m) | ||
if [ "$WallGoMatrixVersion" == "${{ env.tag }}" ]; then | ||
echo "WallGoMatrixVersion matches the tag" | ||
else | ||
echo "Error: WallGoMatrixVersion ($WallGoMatrixVersion) does not match tag (${{ env.tag }})" 1>&2 | ||
exit 64 | ||
fi | ||
if [ "$WallGoMatrixVersionDate" == "${{ env.date }}" ]; then | ||
echo "WallGoMatrixVersionDate matches the date" | ||
else | ||
echo "Error: WallGoMatrix date $WallGoMatrixVersionDate does not match date ${{ env.date }}" 1>&2 | ||
exit 64 | ||
fi | ||
# - name: Update version and date in WallGoMatrix.m | ||
# run: | | ||
# sed -i.bak \ | ||
# -e "s/WallGoMatrix\`\$WallGoMatrixVersion = \".*\";/WallGoMatrix\`\$WallGoMatrixVersion = \"${{ env.tag }}\"\;/" \ | ||
# -e "s/WallGoMatrix\`\$WallGoMatrixVersionDate = \".*\"\;/WallGoMatrix\`\$WallGoMatrixVersionDate = \"${{ env.date }}\"\;/" \ | ||
# WallGoMatrix.m | ||
|
||
# - name: Commit and push version update | ||
# run: | | ||
# git config --global user.name 'github-actions' | ||
# git config --global user.email '[email protected]' | ||
# rm WallGoMatrix.m.bak | ||
# git add WallGoMatrix.m | ||
# git commit -m "Update WallGoMatrix version to ${{ env.tag }} and date to ${{ env.date }}" | ||
# git push origin HEAD | ||
|
||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
|
@@ -46,4 +87,4 @@ jobs: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./WallGoMatrix_${{ github.ref_name }}.zip | ||
asset_name: WallGoMatrix_${{ github.ref_name }}.zip | ||
asset_content_type: application/zip | ||
asset_content_type: application/zip |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -107,7 +107,3 @@ | |
ParticleName, | ||
ParticleMasses, | ||
{TruncateAtLeadingLog->True,Format->{"json","txt"}}]; | ||
|
||
|
||
|
||
|