-
Notifications
You must be signed in to change notification settings - Fork 1
101 lines (86 loc) · 2.83 KB
/
package-julia.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: package-julia
on:
pull_request:
push:
branches:
- main
release:
types:
- published
defaults:
run:
shell: bash
jobs:
test:
name: Build and test package-julia
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 100
- name: Fetch git tags
run: git fetch origin 'refs/tags/*:refs/tags/*'
- uses: julia-actions/setup-julia@v1
with:
version: '1.6'
- name: Install dependencies
run: julia -e 'import Pkg; Pkg.add("DataStructures"); Pkg.add("JSON")'
- name: Create package files
run: |
cd packages
julia --color=yes create_julia.jl
- name: Build package
run: |
cd packages/julia/LibDLF.jl
julia --color=yes --project=@. -e 'using Pkg; if VERSION >= v"1.1.0-rc1"; Pkg.build(verbose=true); else Pkg.build(); end'
- name: Run tests
run: |
cd packages/julia/LibDLF.jl
julia --check-bounds=yes --color=yes --project=./ -e 'import Pkg; Pkg.test()'
deploy:
name: Deploy package-julia
runs-on: ubuntu-latest
needs: test
# Only from the origin repository, not forks; only main and tags.
if: github.repository_owner == 'emsig' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 100
- name: Fetch git tags
run: git fetch origin 'refs/tags/*:refs/tags/*'
- uses: julia-actions/setup-julia@v1
with:
version: '1.6'
- name: Install dependencies
run: julia -e 'import Pkg; Pkg.add("DataStructures"); Pkg.add("JSON")'
- name: Create package
run: |
cd packages
julia create_julia.jl
- name: Deploy to packages-julia branch
uses: s0/git-publish-subdir-action@develop
if: success()
env:
REPO: self
BRANCH: package-julia
FOLDER: packages/julia
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CLEAR_GLOBS_FILE: ".github/workflows/.clear-target-files"
- name: check out package-julia branch
uses: actions/checkout@v2
with:
ref: package-julia
#- name: get last commit SHA on package-julia branch
- id: get-sha
run: |
sha=$(git log -1 --format=format:"%H")
echo ::set-output name=last_sha::$sha
- name: Create commit comment
uses: peter-evans/commit-comment@v1
with:
body: |
@JuliaRegistrator register subdir=LibDLF.jl branch=package-julia
sha: ${{ steps.get-sha.outputs.last_sha }}