Add a workflow to release #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- trunk | |
workflow_dispatch: | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
if: github.repository_owner == 'Goooler' && github.ref == 'refs/heads/trunk' | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Pack the project | |
run: zip -r systemless-fcm-hosts.zip . -x "*.git*" | |
- name: Generate release name with current date | |
run: echo "RELEASE_NAME=$(date +'%Y%m%d')" >> $GITHUB_ENV | |
- name: Delete release if exist then create release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh release view ${{ env.RELEASE_NAME }} && gh release delete ${{ env.RELEASE_NAME }} -y --cleanup-tag | |
gh release create ${{ env.RELEASE_NAME }} systemless-fcm-hosts.zip -t ${{ env.RELEASE_NAME }} --generate-notes |