Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: adding automated release creating
* taiki-e/create-gh-release-action#13 * https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
- Loading branch information
1 parent
1236a8a
commit edd6de0
Showing
3 changed files
with
49 additions
and
0 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,20 @@ | ||
name: Releasing | ||
on: | ||
push: | ||
branches: [main] | ||
permissions: | ||
contents: write | ||
jobs: | ||
Releasing: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download Earthly v0.7.5. | ||
run: "sudo /bin/sh -c 'wget https://github.com/earthly/earthly/releases/download/v0.7.5/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly'" | ||
- name: Checkout code. | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Releasing. | ||
run: earthly --ci --secret GH_TOKEN +releasing | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by GitHub Actions. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/env sh | ||
|
||
set -o errexit | ||
set -o xtrace | ||
|
||
# Get current version. | ||
current_version=$(cat "VERSION") | ||
# If the tag already exist then exit. | ||
git tag -l | grep -q "^${current_version}$" && exit 0 | ||
# Where to start generating the release description from. | ||
base_commit=$(git rev-list --max-parents=0 HEAD) | ||
# latest_tag=$(git tag --sort=committerdate | tail -1) | ||
# latest_tag=$(git show ${_arg_from_reference}:VERSION) | ||
description_from="${latest_tag:-${base_commit}}" | ||
# Generate the release description. | ||
release_description=$(git log --format="* %s" ${description_from}.. --no-merges) | ||
# Create release and the tag. | ||
gh release create "${current_version}" |