Skip to content

allow workflow to write the release #1101

allow workflow to write the release

allow workflow to write the release #1101

Workflow file for this run

name: Build, Sign and Release
on:
push:
tags:
- '**[0-9]+.[0-9]+.[0-9]+*'
permissions:
contents: write
jobs:
build-macos:
uses: ./.github/workflows/release_macos.yml
with:
binary_list: api-blockchain-scanner-daemon,api-web-server,dns-server,node-daemon,wallet-address-generator,wallet-cli,wallet-rpc-daemon
secrets: inherit
build-linux:
uses: ./.github/workflows/release_linux.yml
with:
binary_list: api-blockchain-scanner-daemon,api-web-server,dns-server,node-daemon,wallet-address-generator,wallet-cli,wallet-rpc-daemon
secrets: inherit
build-windows:
uses: ./.github/workflows/release_windows.yml
with:
binary_list: api-blockchain-scanner-daemon,api-web-server,dns-server,node-daemon,wallet-address-generator,wallet-cli,wallet-rpc-daemon
secrets: inherit
build-docker:
needs: [build-macos, build-linux, build-windows]
uses: ./.github/workflows/release_docker.yml
secrets: inherit
create-release:
needs: [build-macos, build-linux, build-windows, build-docker]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4
- name: Extract version from tag
id: get_version
run: |
VERSION=${GITHUB_REF#refs/tags/}
VERSION=${VERSION#v}
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Download Artifacts
uses: actions/download-artifact@v4
- name: Generate Hashes
id: generate_hashes
run: |
echo "HASHES<<EOF" >> $GITHUB_OUTPUT
for file in Mintlayer_Node_*/*.dmg Mintlayer_Node_*/*.deb Mintlayer_Node_*/*.rpm Mintlayer_Node_*/*.zip Mintlayer_Node_*/*_Setup.exe; do
if [ -f "$file" ]; then
echo "$(sha256sum $file | awk '{print $1}') $(basename $file)" >> $GITHUB_OUTPUT
fi
done
echo "EOF" >> $GITHUB_OUTPUT
- name: Generate Release Body
id: generate_body
run: |
echo "BODY<<EOF" >> $GITHUB_OUTPUT
echo "Release version ${{ steps.get_version.outputs.VERSION }}" >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
echo "This release includes the following packages:" >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
echo "macOS:" >> $GITHUB_OUTPUT
echo "- Mintlayer Node GUI (DMG) for Intel and Apple Silicon" >> $GITHUB_OUTPUT
echo "- Mintlayer Node (ZIP) for Intel and Apple Silicon" >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
echo "Linux:" >> $GITHUB_OUTPUT
echo "- Mintlayer Node GUI (DEB) for x86_64 and ARM64" >> $GITHUB_OUTPUT
echo "- Mintlayer Node (DEB and TGZ) for x86_64 and ARM64" >> $GITHUB_OUTPUT
echo "- Mintlayer Node GUI (RPM) for x86_64" >> $GITHUB_OUTPUT
echo "- Mintlayer Node (RPM) for x86_64" >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
echo "Windows:" >> $GITHUB_OUTPUT
echo "- Mintlayer Node GUI (ZIP) for x64" >> $GITHUB_OUTPUT
echo "- Mintlayer Node GUI Installer (EXE) for x64" >> $GITHUB_OUTPUT
echo "- Mintlayer Node (ZIP) for x86" >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
echo "Please download the appropriate package for your system." >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
echo "Docker Images" >> $GITHUB_OUTPUT
echo "Find docker images in the docker hub:" >> $GITHUB_OUTPUT
echo "https://hub.docker.com/u/mintlayer" >> $GITHUB_OUTPUT
echo "" >> $GITHUB_OUTPUT
echo "File Hashes (SHA256):" >> $GITHUB_OUTPUT
echo "\`\`\`" >> $GITHUB_OUTPUT
echo "${{ steps.generate_hashes.outputs.HASHES }}" >> $GITHUB_OUTPUT
echo "\`\`\`" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Create Release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifacts: "Mintlayer_Node_*/*.dmg,Mintlayer_Node_*/*.deb,Mintlayer_Node_*/*.rpm,Mintlayer_Node_*/*.zip,Mintlayer_Node_*/*.tar.gz,Mintlayer_Node_*/*_Setup.exe"
artifactErrorsFailBuild: true
name: "Release ${{ steps.get_version.outputs.VERSION }}"
body: ${{ steps.generate_body.outputs.BODY }}
token: ${{ secrets.GITHUB_TOKEN }}