ci: generate changelog before release #10
Workflow file for this run
This file contains hidden or 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: Hierarchy build | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| build: | |
| [ | |
| { | |
| name: hierarchy-app, | |
| platform: linux/amd64, | |
| os: ubuntu-latest, | |
| artifact: "hierarchy-app-linux-amd64", | |
| }, | |
| { | |
| name: hierarchy-app, | |
| platform: windows/amd64, | |
| os: windows-latest, | |
| artifact: "hierarchy-app-windows-amd64.exe", | |
| }, | |
| { | |
| name: hierarchy-app, | |
| platform: darwin/universal, | |
| os: macos-latest, | |
| artifact: "hierarchy-app-darwin-universal", | |
| }, | |
| ] | |
| runs-on: ${{ matrix.build.os }} | |
| steps: | |
| - uses: actions/checkout@v2 | |
| with: | |
| submodules: recursive | |
| - uses: dAppServer/wails-build-action@main | |
| with: | |
| build-name: ${{ matrix.build.name }} | |
| build-platform: ${{ matrix.build.platform }} | |
| build-obfuscate: true | |
| go-version: 1.25 | |
| release: | |
| needs: build | |
| if: always() | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: ./artifacts | |
| - name: Display structure of downloaded files | |
| run: ls -R ./artifacts | |
| - name: Prepare release assets | |
| run: | | |
| # Create a directory for release assets | |
| mkdir -p release-assets | |
| # Find and organize build artifacts | |
| find ./artifacts -type f -name "hierarchy-app*" | while read file; do | |
| # Extract platform name from artifact folder | |
| dirname=$(dirname "$file") | |
| platform=$(basename "$dirname" | sed 's/hierarchy-app-//') | |
| # Get file extension | |
| filename=$(basename "$file") | |
| extension="${filename##*.}" | |
| # Create new filename with platform and extension | |
| if [ "$extension" = "exe" ]; then | |
| new_name="hierarchy-app-${platform}.exe" | |
| else | |
| new_name="hierarchy-app-${platform}" | |
| fi | |
| # Copy to release assets with proper naming | |
| cp "$file" "./release-assets/$new_name" | |
| chmod +x "./release-assets/$new_name" | |
| done | |
| echo "Release assets prepared:" | |
| ls -la ./release-assets/ | |
| - name: Generate changelog | |
| run: | | |
| # Get commits since last tag | |
| git fetch --tags | |
| LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "") | |
| if [ -z "$LAST_TAG" ]; then | |
| CHANGES=$(git log --oneline) | |
| else | |
| CHANGES=$(git log $LAST_TAG..HEAD --oneline) | |
| fi | |
| echo "CHANGELOG<<EOF" >> $GITHUB_ENV | |
| echo "$CHANGES" >> $GITHUB_ENV | |
| echo "EOF" >> $GITHUB_ENV | |
| - name: Create Release | |
| id: create_release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| name: Release ${{ github.ref_name }} | |
| body: | | |
| ## Release Notes | |
| ${{ env.CHANGELOG }} | |
| --- | |
| Release for ${{ github.ref_name }} | |
| ### Assets | |
| - hierarchy-app-linux-amd64 (Linux) | |
| - hierarchy-app-windows-amd64.exe (Windows) | |
| - hierarchy-app-darwin-universal (macOS) | |
| draft: false | |
| prerelease: false | |
| files: | | |
| release-assets/hierarchy-app-* | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |