feat: streamline GitHub Actions release workflow by consolidating permissions and enhancing GitHub CLI installation step
This commit is contained in:
parent
bf67a635f6
commit
3e9b89f69b
26
.github/workflows/release.yml
vendored
26
.github/workflows/release.yml
vendored
@ -6,16 +6,11 @@ on:
|
|||||||
- 'v*'
|
- 'v*'
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write # for creating releases and uploading assets
|
contents: write
|
||||||
discussions: write # if you want to allow release discussions
|
|
||||||
packages: write # if you're publishing packages
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
# Add permissions at job level as well
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
@ -60,23 +55,16 @@ jobs:
|
|||||||
echo "$CHANGELOG" >> $GITHUB_OUTPUT
|
echo "$CHANGELOG" >> $GITHUB_OUTPUT
|
||||||
echo "EOF" >> $GITHUB_OUTPUT
|
echo "EOF" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Install GitHub CLI
|
- name: Install and Configure GitHub CLI
|
||||||
run: |
|
run: |
|
||||||
type -p curl >/dev/null || (sudo apt update && sudo apt install curl -y)
|
sudo apt update
|
||||||
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
|
sudo apt install gh -y
|
||||||
&& sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
|
|
||||||
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
|
|
||||||
&& sudo apt update \
|
|
||||||
&& sudo apt install gh -y
|
|
||||||
|
|
||||||
- name: Create Release and Upload Assets
|
- name: Create Release with GitHub CLI
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
# Create release
|
gh release create "${{ github.ref_name }}" \
|
||||||
gh release create ${{ github.ref_name }} \
|
|
||||||
--title "Release ${{ steps.get_version.outputs.VERSION }}" \
|
--title "Release ${{ steps.get_version.outputs.VERSION }}" \
|
||||||
--notes "${{ steps.changelog.outputs.CHANGES }}" \
|
--notes "${{ steps.changelog.outputs.CHANGES }}" \
|
||||||
".pio/build/esp32dev/filaman.bin#filaman-${{ steps.get_version.outputs.VERSION }}.bin" \
|
".pio/build/esp32dev/filaman.bin#filaman.bin"
|
||||||
--draft false \
|
|
||||||
--prerelease false
|
|
Loading…
x
Reference in New Issue
Block a user