2024-11-12 15:19:55 +00:00
|
|
|
name: Publish
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- "v*"
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
publish:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
|
|
- name: Download pesde
|
|
|
|
run: |
|
|
|
|
# Figure out the latest release
|
|
|
|
latest_release=$(curl -s https://api.github.com/repos/daimond113/pesde/releases | jq '[.[] | select(.prerelease == true or .prerelease == false)][0]')
|
|
|
|
download_url=$(echo "$latest_release" | jq -r '.assets[] | select(.name | endswith("linux-x86_64.tar.gz")) | .browser_download_url')
|
|
|
|
|
|
|
|
# Download and extract the linux-x86_64 artifact
|
|
|
|
curl -L -o /tmp/pesde.tar.gz "$download_url"
|
|
|
|
tar -xzvf /tmp/pesde.tar.gz
|
|
|
|
chmod +x pesde
|
|
|
|
|
|
|
|
# Install, cleanup and set PATH
|
|
|
|
./pesde self-install
|
|
|
|
rm ./pesde
|
|
|
|
echo "$HOME/.pesde/bin" >> $GITHUB_PATH
|
|
|
|
|
|
|
|
- name: Authenticate into pesde registry
|
|
|
|
run: |
|
2024-11-12 15:44:46 +00:00
|
|
|
cat > $HOME/.pesde/config.toml << 'EOF'
|
|
|
|
default_index = "https://github.com/daimond113/pesde-index"
|
|
|
|
scripts_repo = "https://github.com/daimond113/pesde-scripts"
|
2024-11-12 15:19:55 +00:00
|
|
|
|
2024-11-12 15:44:46 +00:00
|
|
|
[tokens]
|
|
|
|
"https://github.com/daimond113/pesde-index.git" = "${{ secrets.PESDE_TOKEN }}"
|
|
|
|
EOF
|
2024-11-12 15:19:55 +00:00
|
|
|
- name: Publish
|
|
|
|
run: pesde publish --dry-run
|