-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
83 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,82 @@ | ||
--- | ||
name: Create release | ||
|
||
on: | ||
push: | ||
branches: ["main", "master"] | ||
# Release whenever this file changes | ||
paths: | ||
- "./version.txt" | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
|
||
generateTag: | ||
|
||
name: "Auto-generate Git tag whenever version.txt changes" | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
|
||
steps: | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Fetch git tags | ||
run: git fetch --force --tags | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: stable | ||
cache-dependency-path: src/wp2hugo/go.sum | ||
|
||
- name: Read version name | ||
id: read-version | ||
run: | | ||
echo "version=$(cat ./version.txt)" > "$GITHUB_OUTPUT" | ||
- name: Create new tag | ||
id: tag_version | ||
uses: mathieudutour/[email protected] | ||
with: | ||
custom_tag: ${{ steps.read-version.outputs.version }} | ||
tag_prefix: "" # To prevent extra "v" in the prefix | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
releaseBinary: | ||
|
||
name: "Release Go binaries with Go Releaser" | ||
runs-on: ubuntu-latest | ||
needs: generateTag | ||
timeout-minutes: 15 | ||
|
||
steps: | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Fetch git tags | ||
run: git fetch --force --tags | ||
|
||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: stable | ||
cache-dependency-path: src/wp2hugo/go.sum | ||
|
||
# More assembly might be required: Docker logins, GPG, etc. It all depends | ||
# on your needs. | ||
- uses: goreleaser/goreleaser-action@v5 | ||
with: | ||
distribution: goreleaser | ||
version: latest | ||
args: release --clean --debug | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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 @@ | ||
1.0 |