disable changelog (#180) #97
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
name: Publish Release | |
concurrency: | |
group: ci-${{ github.repository }}-release | |
cancel-in-progress: false | |
on: | |
push: | |
branches: | |
- "main" | |
paths-ignore: | |
- "docs/**" | |
- "CHANGELOG.md" | |
jobs: | |
create-release: | |
uses: fullstack-devops/git-workflows/.github/workflows/create-release.yml@main | |
secrets: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
quality-gate: | |
runs-on: ubuntu-latest | |
needs: [create-release] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
cache: true | |
- name: Test | |
run: make test/cover | |
- name: Audit | |
run: make audit | |
- name: debugging git | |
run: | | |
echo "git name-rev HEAD: $(git name-rev HEAD)" | |
echo "git log -1 --pretty=format:"%s": $(git log -1 --pretty=format:"%s")" | |
echo "git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@': $(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@')" | |
build: | |
runs-on: ubuntu-latest | |
needs: [create-release, quality-gate] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
cache: true | |
- name: Build | |
run: make | |
env: | |
VERSION: "${{ needs.create-release.outputs.version }}" | |
- name: Setup UPX | |
uses: crazy-max/ghaction-upx@v3 | |
with: | |
install-only: true | |
- name: Compress binaries with upx | |
run: make upx | |
env: | |
VERSION: "${{ needs.create-release.outputs.version }}" | |
- name: Cache build outputs | |
uses: actions/cache@v4 | |
env: | |
cache-name: cache-outputs-modules | |
with: | |
path: build/package/ | |
key: awesome-ci-${{ github.sha }}-${{ hashFiles('build/package/awesome-ci*') }} | |
restore-keys: | | |
awesome-ci-${{ github.sha }} | |
publish-release: | |
environment: production | |
runs-on: ubuntu-latest | |
needs: [create-release, build] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup awesome-ci | |
uses: fullstack-devops/awesome-ci-action@main | |
- name: get cached build outputs | |
uses: actions/cache@v4 | |
env: | |
cache-name: cache-outputs-modules | |
with: | |
path: build/package/ | |
key: awesome-ci-${{ github.sha }} | |
- name: list generated artifacts | |
working-directory: build/package | |
run: ls -la | |
- name: Publish Release | |
run: >- | |
awesome-ci release publish --release-id ${{ needs.create-release.outputs.releaseid }} | |
-a "file=build/package/awesome-ci_${{ needs.create-release.outputs.version }}_linux-amd64" | |
-a "file=build/package/awesome-ci_${{ needs.create-release.outputs.version }}_linux-arm64" | |
-a "file=build/package/awesome-ci_${{ needs.create-release.outputs.version }}_windows-amd64.exe" | |
-a "file=build/package/awesome-ci_${{ needs.create-release.outputs.version }}_windows-arm64.exe" | |
--body "build/package/release-template.md" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
update_action: | |
runs-on: ubuntu-latest | |
needs: [create-release, publish-release] | |
steps: | |
- name: Check out awesome-ci-action | |
uses: actions/checkout@v4 | |
with: | |
repository: fullstack-devops/awesome-ci-action | |
token: ${{ secrets.ACI_REPO_TOKEN }} | |
persist-credentials: true | |
- name: Update version and push | |
run: | | |
git config user.name "$GITHUB_ACTOR" | |
git config user.email "$GITHUB_ACTOR@users.noreply.github.com" | |
sed -i "s/\([0-9]\+\.[0-9]\+\.[0-9]\+\)/$NEW_VERSION/g" action.yml README.md | |
git status | |
git commit -a -m "update to version v$NEW_VERSION" | |
git tag v$NEW_VERSION -m "update to version v$NEW_VERSION" | |
git push --follow-tags | |
env: | |
NEW_VERSION: ${{ needs.create-release.outputs.version }} |