joshghent / gifbar

🦄 Find Awesome Gif's right in your Menu Bar
MIT License
42 stars 31 forks source link

[feature] Setup releases with GitHub Actions #198

Open joshghent opened 1 year ago

joshghent commented 1 year ago

As it says on the tin really!

teschiopol commented 1 year ago

Hi, i did something can be useful to start with:


# Controls when the action will run. Triggers the workflow on push events but only for the master branch
on:
  push:
    branches: [ master ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "build"
  build:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest
    permissions:
      # Give the default GITHUB_TOKEN write permission to commit and push the
      # added or changed files to the repository.
      contents: write
    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
    - uses: actions/checkout@v3
    - uses: actions/setup-node@v3
      with:
        node-version: '16'
    - name: Install
      run: npm install
    - name: Run script file
      run: npm run todo
    - name: Auto commit
      uses: stefanzweifel/git-auto-commit-action@v4
      with:
        commit_message: Automated TODO
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    - name: Build
      run: npm run build
      env:
        CI: true
    - name: Final Check
      if: ${{success()}}
      run: |
        echo Success

In that case is an auto commit, but for tag it's the same, instead of commit, push a tag. "npm run todo" call a custom script that generate a TODO.md file. Simple switch to manage a CHANGELOG.md based on some rules that we can define.

What do you think?

joshghent commented 1 year ago

@teschiopol looks good! Agree it needs to tag and push that rather than commit, but nice work! Did you want to submit a PR?

teschiopol commented 1 year ago

Do u wanto to trigger that action on every push on master?

joshghent commented 1 year ago

Sounds good!