Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
caisar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
caisar
Commits
abba1d6c
Commit
abba1d6c
authored
2 years ago
by
Michele Alberti
Browse files
Options
Downloads
Patches
Plain Diff
[opam] Add Makefile target for creating and releasing opam package.
parent
5a01f0aa
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Makefile
+31
-0
31 additions, 0 deletions
Makefile
with
31 additions
and
0 deletions
Makefile
+
31
−
0
View file @
abba1d6c
...
...
@@ -9,3 +9,34 @@ promote:
clean
:
dune clean
###################################
# opam package creation and release
###################################
PROJECT_ID
=
1082
TAG
=
$(
shell dune-release tag
-f
--yes
>
/dev/null 2>&1
&&
git describe
--tags
--abbrev
=
0
)
PKG
=
"caisar-
$(
TAG
)
.tbz"
PACKAGE_URL
=
"https://git.frama-c.com/api/v4/projects/
$(
PROJECT_ID
)
/packages/generic/caisar/
$(
TAG
)
/
$(
PKG
)
"
DESCRIPTION
=
"
$(
shell sed -n -e "
p
;
n
;
:next
;
/^##/Q
;
p
;
n
;
b next
" CHANGES.md | perl -pe 's/
\n
/
\\
n/'
)
"
release
:
@
echo
-n
$(
DESCRIPTION
)
@
echo
"Is the CHANGES.md correct for
$(
TAG
)
(y/n)?"
@
read
yesno
;
test
"
$$
yesno"
=
y
dune-release tag
$(
TAG
)
dune-release distrib
--skip-build
--skip-lint
curl
--header
"PRIVATE-TOKEN:
$(
GITLAB_TOKEN
)
"
\
--upload-file
_build/
$(
PKG
)
\
$(
PACKAGE_URL
)
echo
$(
PACKAGE_URL
)
>
_build/asset-
$(
TAG
)
.url
git push origin
$(
TAG
)
curl
--header
'Content-Type: application/json'
\
--header
"PRIVATE-TOKEN:
$(
GITLAB_TOKEN
)
"
\
--request
POST
"https://git.frama-c.com/api/v4/projects/
$(
PROJECT_ID
)
/releases"
\
--data
'{"name": "Release
$(
TAG
)
","tag_name": "
$(
TAG
)
", "description":
$(
DESCRIPTION
)
, "milestones": [], "assets": { "links": [{ "name": "
$(
PKG
)
", "url":
$(
PACKAGE_URL
)
, "link_type":"other" }] } }'
dune-release opam pkg
dune-release opam submit
.PHONY
:
release clean promote test all
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment