Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .github/rpm/twiliorc.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Spec file is needed to build a rpm package
Name: twilio
Version: %{_version}
Release: %{_release}
Summary: A CLI for Twilio
BuildArch: x86_64
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root

License: MIT
URL: https://github.com/twilio/twilio-cli
Source: %{name}-v%{version}-%{_release}-linux-x64.tar.gz

#BuildRequires:
Requires: bash

# Disable Fedora's shebang mangling script,
# which errors out on any file with versionless `python` in its shebang
# See: https://github.com/atom/atom/issues/21937
%undefine __brp_mangle_shebangs
# Disable debug package
%global debug_package %{nil}

%description
The Twilio CLI allows you to manage your Twilio resources from your terminal or command prompt.
Head over to https://www.twilio.com/docs/twilio-cli/quickstart.

%prep
%setup -q -n %{name}

%build

%install
rm -rf %{buildroot}/%{name}-%{version}-%{release}
mkdir -p %{buildroot}/usr/local/lib/%{name}
mkdir -p %{buildroot}/usr/local/bin
cp -a $RPM_BUILD_DIR/%{name}/* %{buildroot}/usr/local/lib/%{name}

%clean
rm -rf %{buildroot}/%{name}-%{version}-%{release}
rm -rf $RPM_BUILD_DIR

%post
ln -sf /usr/local/lib/%{name}/bin/%{name} /usr/local/bin/%{name}
cd /usr/local/lib/%{name}
PATH=$PATH:$PWD/bin eval $(PATH=$PATH:$PWD/bin node -p "require('./package').scripts.postinstall")

%postun
rm -f /usr/local/bin/%{name}

%files
%defattr(-,root,root,-)
%license LICENSE
%doc README.md
%{_prefix}

%changelog
39 changes: 30 additions & 9 deletions .github/workflows/debian-executable-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,46 @@ jobs:
run: |
git fetch --prune --unshallow
echo "::set-output name=TAG_NAME::$(git describe --tags $(git rev-list --tags --max-count=1))"

- name: process version and release
if: contains(steps.get-tag.outputs.TAG_NAME, 'rc' )
id: process-release-version
run: |
releaseVersionString=${{ steps.get-tag.outputs.TAG_NAME}}
echo "::set-output name=version::$(echo "$releaseVersionString" | cut -d- -f1)"

- name: Setting file path
id: set-file-path
run: |
if [[ ${{ steps.get-tag.outputs.TAG_NAME }} == *"rc"* ]]; then
file_path_amd64=dist/deb/${{ github.event.inputs.formula }}_${{ steps.process-release-version.outputs.VERSION }}.${{ steps.get-sha.outputs.SHA_SHORT }}-1_amd64.deb
file_path_armel=dist/deb/${{ github.event.inputs.formula }}_${{ steps.process-release-version.outputs.VERSION }}.${{ steps.get-sha.outputs.SHA_SHORT }}-1_armel.deb
else
file_path_amd64=dist/deb/${{ github.event.inputs.formula }}_${{ steps.get-tag.outputs.TAG_NAME }}.${{ steps.get-sha.outputs.SHA_SHORT }}-1_amd64.deb
file_path_armel=dist/deb/${{ github.event.inputs.formula }}_${{ steps.get-tag.outputs.TAG_NAME }}.${{ steps.get-sha.outputs.SHA_SHORT }}-1_armel.deb
fi
echo "FILE_PATH_AMD64=$file_path_amd64" >> $GITHUB_OUTPUT
echo "FILE_PATH_ARMEL=$file_path_armel" >> $GITHUB_OUTPUT

- run: |
make install
sudo chown -R 1001:121 "/root/.npm"
sudo npx oclif pack:deb

- name: Upload binaries to release - amd64
run: node .github/scripts/update-platform-executables.js
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FILE: dist/deb/${{ github.event.inputs.formula }}_${{ steps.get-tag.outputs.TAG_NAME }}.${{ steps.get-sha.outputs.SHA_SHORT }}-1_amd64.deb
ASSET_NAME: ${{ github.event.inputs.formula }}-${{ steps.get-tag.outputs.TAG_NAME }}-amd64.deb
TAG_NAME: ${{ steps.get-tag.outputs.TAG_NAME }}
REPO_NAME: ${{ github.repository }}
# - name: Upload binaries to release - amd64
# run: node .github/scripts/update-platform-executables.js
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# FILE: ${{ steps.set-file-path.outputs.FILE_PATH_AMD64 }}
# ASSET_NAME: ${{ github.event.inputs.formula }}-${{ steps.get-tag.outputs.TAG_NAME }}-amd64.deb
# TAG_NAME: ${{ steps.get-tag.outputs.TAG_NAME }}
# REPO_NAME: ${{ github.repository }}

- name: Upload binaries to release - armel
run: node .github/scripts/update-platform-executables.js
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FILE: dist/deb/${{ github.event.inputs.formula }}_${{ steps.get-tag.outputs.TAG_NAME }}.${{ steps.get-sha.outputs.SHA_SHORT }}-1_armel.deb
FILE: ${{ steps.set-file-path.outputs.FILE_PATH_AMD64 }}
ASSET_NAME: ${{ github.event.inputs.formula }}-${{ steps.get-tag.outputs.TAG_NAME }}-armel.deb
TAG_NAME: ${{ steps.get-tag.outputs.TAG_NAME }}
REPO_NAME: ${{ github.repository }}
Expand Down
32 changes: 26 additions & 6 deletions .github/workflows/macos-executable-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
get-tag:
runs-on: macos-13
outputs:
TAG_NAME: ${{steps.get-tag.outputs.TAG_NAME}}
TAG_NAME: "6.0.0-rc.1"
steps:
- uses: actions/checkout@v2
- name: Getting latest tag
Expand All @@ -28,9 +28,29 @@ jobs:
run: |
git fetch --prune --unshallow
echo "::set-output name=SHA_SHORT::$(git rev-parse --short HEAD)"
pack-macos:
set-file-path:
needs: [get-tag, get-sha]
runs-on: macos-13
outputs:
FILE_PATH_X64: ${{steps.set-file-path.outputs.FILE_PATH_X64}}
FILE_PATH_ARM64: ${{steps.set-file-path.outputs.FILE_PATH_ARM64}}
steps:
- uses: actions/checkout@v2
- name: Setting file path
id: set-file-path
run: |
file_path_x64=dist/macos/${{ github.event.inputs.formula }}-v${{ needs.get-tag.outputs.TAG_NAME }}.${{ needs.get-sha.outputs.SHA_SHORT }}.pkg
file_path_arm64=dist/macos/${{ github.event.inputs.formula }}-v${{ needs.get-tag.outputs.TAG_NAME }}.${{ needs.get-sha.outputs.SHA_SHORT }}-arm64.pkg
echo "FILE_PATH_X64=$file_path_x64" >> $GITHUB_OUTPUT
echo "FILE_PATH_ARM64=$file_path_arm64" >> $GITHUB_OUTPUT

- name: set-file-path outputs
run: |
echo FILE_PATH_X64: ${{ steps.set-file-path.outputs.FILE_PATH_X64 }}
echo FILE_PATH_ARM64: ${{ steps.set-file-path.outputs.FILE_PATH_ARM64 }}
pack-macos:
needs: [set-file-path]
runs-on: macos-13
steps:
- uses: actions/checkout@v2
- run: source .github/scripts/pack_macos.sh
Expand All @@ -41,7 +61,7 @@ jobs:
APPLE_ID_APP_PASSWORD: ${{ secrets.APPLE_ID_APP_PASSWORD}}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID}}
# FILE_PATH_ARM64: dist/macos/${{ github.event.inputs.formula }}-v${{ needs.get-tag.outputs.TAG_NAME }}-${{ needs.get-sha.outputs.SHA_SHORT }}-arm64.pkg
FILE_PATH_X64: dist/macos/${{ github.event.inputs.formula }}-v${{ needs.get-tag.outputs.TAG_NAME }}.pkg
FILE_PATH_X64: ${{ needs.set-file-path.outputs.FILE_PATH_X64 }}
REPOSITORY_OWNER: ${{ github.repository_owner }}
# TODO: enable these when oclif pack : macos starts working fine
# - name: Upload binaries to release - arm64
Expand All @@ -59,9 +79,9 @@ jobs:
node .github/scripts/update-platform-executables.js
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FILE: dist/macos/${{ github.event.inputs.formula }}-v${{ needs.get-tag.outputs.TAG_NAME }}.pkg
ASSET_NAME: ${{ github.event.inputs.formula }}-${{ needs.get-tag.outputs.TAG_NAME }}-x64.pkg
TAG_NAME: ${{ needs.get-tag.outputs.TAG_NAME }}
FILE: ${{ needs.set-file-path.outputs.FILE_PATH_X64 }}
ASSET_NAME: "twilio-6.0.0-rc.1-x64.pkg"
TAG_NAME: "6.0.0-rc.1"
REPO_NAME: ${{ github.repository }}


Expand Down
Loading
Loading