-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Publish to npm using a GitHub action (#9588)
- Loading branch information
1 parent
60005b3
commit f2ee84b
Showing
5 changed files
with
59 additions
and
14 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM debian:stable-slim | ||
|
||
LABEL "name"="create-release-tag" | ||
LABEL "version"="0.0.1" | ||
|
||
LABEL "com.github.actions.name"="Create release tag" | ||
LABEL "com.github.actions.description"="Creates a release tag equal to the last commit message" | ||
LABEL "com.github.actions.icon"="tag" | ||
LABEL "com.github.actions.color"="gray-dark" | ||
|
||
ADD entrypoint.sh /action/entrypoint.sh | ||
|
||
RUN chmod +x /action/entrypoint.sh | ||
RUN apt-get update && apt-get install -y --no-install-recommends git | ||
|
||
ENTRYPOINT ["/action/entrypoint.sh"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
# GitHub doesn't support running actions on new tags yet: we need to run it on the commit. | ||
# For this reason, we can't be sure that the tag already exists. We can use the commit | ||
# message to create the tag. If the tag already exists locally, they won't conflict because | ||
# they have the same name and are on the same commit. | ||
|
||
echo "INFO: Getting release version..." | ||
tag_name=$(git log --oneline --format=%B -1 $GITHUB_SHA) | ||
|
||
echo "INFO: Creating new tag..." | ||
(git tag $tag_name $GITHUB_SHA) || echo "INFO: Tag already exists" |
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
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
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