Replace setup.py by pyproject.toml (#29) #58
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: 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 }} | |