Update error message [deploy] #11
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: Deployment | |
on: | |
workflow_dispatch: | |
push: | |
branches: '*' | |
jobs: | |
publish: | |
if: ${{ !(github.event_name == 'push') || contains(github.event.head_commit.message, '[deploy]') }} | |
runs-on: ubuntu-latest | |
env: | |
GH_REPO: ${{ github.repository }} | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: julia-actions/setup-julia@v1 | |
with: | |
version: '1.10' | |
- name: Create distribution directories | |
run: | | |
cd $GITHUB_WORKSPACE | |
mkpath ./dist/build/ | |
mkpath ./dist/cache/ | |
- name: Retrieve Last Release Tag | |
run: | | |
cd $GITHUB_WORKSPACE | |
LAST_TAG="$(gh release view | sed -nr 's/tag:\s*(v\S*)/\1/p')" | |
echo "$LAST_TAG" >> ./dist/build/last.tag | |
- name: Build and Deploy QUBOLib | |
run: | | |
cd $GITHUB_WORKSPACE | |
julia --proj=./scripts/build ./scripts/build/script.jl --deploy | |
- name: Load Next Release Tag | |
run: | | |
cd $GITHUB_WORKSPACE | |
NEXT_TAG="$(cat $GITHUB_WORKSPACE/dist/build/next.tag)" | |
echo "NEXT_TAG=$NEXT_TAG" >> $GITHUB_ENV | |
- name: Write release title | |
run: | | |
TITLE="$(cat $GITHUB_WORKSPACE/dist/build/title.txt)" | |
echo "TITLE=$TITLE" >> $GITHUB_ENV | |
- name: Publish QUBOLib data release | |
run: > | |
gh release create $NEXT_TAG | |
--latest | |
--notes-file "$GITHUB_WORKSPACE/dist/build/NOTES.md" | |
--title "$TITLE" | |
--target $GITHUB_SHA | |
$GITHUB_WORKSPACE/dist/build/qubolib.tar.gz | |
# - name: Update Documentation | |
# run: | | |
# git config user.name "github-actions" | |
# git config user.email "[email protected]" | |
# git add "./*README.md" | |
# git commit --allow-empty -m "Update Documentation" | |
# git push | |
- name: Clean up old mirror release | |
run: | | |
gh release delete mirror --yes || true | |
git push origin --delete refs/tags/mirror || true | |
- name: Switch to mirror branch | |
run: git checkout mirror | |
- name: Publish mirror release | |
run: > | |
gh release create mirror | |
--prerelease | |
--notes-file "$GITHUB_WORKSPACE/dist/build/mirror/NOTES.md" | |
--title "$SUBJECT" | |
--target $GITHUB_SHA | |
$GITHUB_WORKSPACE/dist/build/mirror/*.zip |