This repository has been archived by the owner on Jul 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
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 290c182
Showing
3 changed files
with
48 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,17 @@ | ||
#!/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 notes from. | ||
base_commit=$(git rev-list --max-parents=0 HEAD) | ||
latest_tag=$(git describe --exact-match --tags || echo "") | ||
notes_from="${latest_tag:-${base_commit}}" | ||
# Generate the release notes. | ||
release_notes=$(git log --format="* %s" ${notes_from}.. --no-merges) | ||
# Create release and the tag. | ||
gh release create "${current_version}" --notes "${release_notes}" |