-
Notifications
You must be signed in to change notification settings - Fork 1
82 lines (70 loc) · 2.39 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Deployment
on:
workflow_dispatch:
push:
branches: '*'
jobs:
deploy:
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
mkdir -p ./dist/build/
mkdir -p ./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 -e 'import Pkg; Pkg.develop(path=@__DIR__)'
julia --proj=./scripts/build ./scripts/build/script.jl --clear-build --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-data" --yes || true
git push origin --delete "refs/tags/mirror-data" || true
- name: Switch to mirror branch
run: git checkout origin mirror
- name: Publish mirror release
run: >
gh release create "mirror-data"
--prerelease
--notes-file "$GITHUB_WORKSPACE/dist/build/mirror/NOTES.md"
--title "$SUBJECT"
--target $GITHUB_SHA
$GITHUB_WORKSPACE/dist/build/mirror/*.zip