Skip to content

Commit

Permalink
Merge pull request #77 from DepsHubHQ/improve-the-release-process-2
Browse files Browse the repository at this point in the history
Fix release issues
  • Loading branch information
semanser authored Jan 9, 2025
2 parents 7b83a66 + bb85e6a commit 49e6341
Showing 1 changed file with 113 additions and 91 deletions.
204 changes: 113 additions & 91 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ permissions:
jobs:
test:
uses: ./.github/workflows/test.yml

build:
needs: test
strategy:
Expand Down Expand Up @@ -54,7 +55,6 @@ jobs:
goos: darwin

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

Expand All @@ -75,22 +75,38 @@ jobs:
with:
name: ${{ matrix.artifact }}
path: ${{ matrix.output }}
package:

release:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Download Artifacts
- name: Download All Artifacts
uses: actions/download-artifact@v4
with:
path: dist
- name: Setup Node.js
uses: actions/setup-node@v4

- name: Create Release
uses: softprops/action-gh-release@v2
with:
node-version: '20'
files: |
dist/**/*
generate_release_notes: true
tag_name: v${{ inputs.version }}
draft: false
prerelease: false

homebrew:
needs: release
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: macos-amd64
path: dist/macos-amd64
- uses: actions/download-artifact@v4
with:
name: macos-arm64
path: dist/macos-arm64

- name: Create Homebrew Formula
run: |
Expand All @@ -116,84 +132,90 @@ jobs:
end
end
EOF
- name: Create DEB Package
run: |
mkdir -p deb/DEBIAN
mkdir -p deb/usr/local/bin
cat > deb/DEBIAN/control << EOF
Package: depshub
Version: ${{ inputs.version }}
Architecture: amd64
Maintainer: Andriy Semenets <semanser@gmail.com>
Description: DepsHub is a tool to manage your dependencies
EOF
cp dist/linux-amd64/depshub-linux-amd64 deb/usr/local/bin/depshub
dpkg-deb --build deb
mv deb.deb depshub_${{ inputs.version }}_amd64.deb
- name: Create RPM Package
run: |
mkdir -p rpmbuild/{SPECS,SOURCES}
cat > rpmbuild/SPECS/depshub.spec << EOF
Name: depshub
Version: ${{ inputs.version }}
Release: 1
Summary: Your depshub tool description
License: AGPL-3.0
%description
DepsHub is a tool to manage your dependencies
%install
mkdir -p %{buildroot}/usr/local/bin
cp %{_sourcedir}/depshub-linux-amd64 %{buildroot}/usr/local/bin/depshub
%files
/usr/local/bin/depshub
EOF
cp dist/linux-amd64/depshub-linux-amd64 rpmbuild/SOURCES/
rpmbuild -bb rpmbuild/SPECS/depshub.spec
- name: Create Chocolatey Package
run: |
mkdir -p choco
cat > choco/depshub.nuspec << EOF
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
<metadata>
<id>depshub</id>
<version>${{ inputs.version }}</version>
<title>Depshub</title>
<authors>Andriy Semenets</authors>
<projectUrl>https://github.com/DepsHubHQ/depshub</projectUrl>
<description>DepsHub is a tool to manage your dependencies</description>
</metadata>
</package>
EOF
mkdir -p choco/tools
cp dist/windows-amd64/depshub-windows-amd64.exe choco/tools/depshub.exe
choco pack choco/depshub.nuspec
release:
needs: package
runs-on: ubuntu-latest
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: dist

- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: |
dist/**/*
*.deb
*.rpm
*.nupkg
depshub.rb
generate_release_notes: true
tag_name: v${{ inputs.version }}
draft: false
prerelease: false
# deb:
# needs: release
# runs-on: ubuntu-latest
# steps:
# - uses: actions/download-artifact@v4
# with:
# name: linux-amd64
# path: dist/linux-amd64
#
# - name: Create DEB Package
# run: |
# mkdir -p deb/DEBIAN
# mkdir -p deb/usr/local/bin
# cat > deb/DEBIAN/control << EOF
# Package: depshub
# Version: ${{ inputs.version }}
# Architecture: amd64
# Maintainer: Andriy Semenets <semanser@gmail.com>
# Description: DepsHub is a tool to manage your dependencies
# EOF
# cp dist/linux-amd64/depshub-linux-amd64 deb/usr/local/bin/depshub
# dpkg-deb --build deb
# mv deb.deb depshub_${{ inputs.version }}_amd64.deb

# rpm:
# needs: release
# runs-on: ubuntu-latest
# steps:
# - uses: actions/download-artifact@v4
# with:
# name: linux-amd64
# path: ~/rpmbuild/SOURCES
#
# - name: Install RPM Build Dependencies
# run: sudo apt-get update && sudo apt-get install -y rpm
#
# - name: Create RPM Package
# run: |
# mkdir -p ~/rpmbuild/{SPECS,BUILD,RPMS,SRPMS}
# cat > ~/rpmbuild/SPECS/depshub.spec << EOF
# Name: depshub
# Version: ${{ inputs.version }}
# Release: 1
# Summary: Your depshub tool description
# License: AGPL-3.0
#
# %description
# DepsHub is a tool to manage your dependencies
#
# %install
# mkdir -p %{buildroot}/usr/local/bin
# cp %{_sourcedir}/depshub-linux-amd64 %{buildroot}/usr/local/bin/depshub
#
# %files
# /usr/local/bin/depshub
# EOF
# rpmbuild -bb ~/rpmbuild/SPECS/depshub.spec

# chocolatey:
# needs: release
# runs-on: ubuntu-latest
# steps:
# - uses: actions/download-artifact@v4
# with:
# name: windows-amd64
# path: dist/windows-amd64
#
# - name: Create Chocolatey Package
# run: |
# mkdir -p choco
# cat > choco/depshub.nuspec << EOF
# <?xml version="1.0" encoding="utf-8"?>
# <package xmlns="http://schemas.microsoft.com/packaging/2015/06/nuspec.xsd">
# <metadata>
# <id>depshub</id>
# <version>${{ inputs.version }}</version>
# <title>Depshub</title>
# <authors>Andriy Semenets</authors>
# <projectUrl>https://github.com/DepsHubHQ/depshub</projectUrl>
# <description>DepsHub is a tool to manage your dependencies</description>
# </metadata>
# </package>
# EOF
# mkdir -p choco/tools
# cp dist/windows-amd64/depshub-windows-amd64.exe choco/tools/depshub.exe
# choco pack choco/depshub.nuspec

0 comments on commit 49e6341

Please sign in to comment.