Skip to content

Commit

Permalink
Merge pull request #10 from snow-actions/release-workflows
Browse files Browse the repository at this point in the history
Release workflows
  • Loading branch information
SnowCait authored May 15, 2022
2 parents 14866aa + 74e8b82 commit b2d06d6
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/draft-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Draft release

on:
pull_request:
types: [ closed ]

jobs:
release:
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/')
runs-on: ubuntu-20.04
timeout-minutes: 5
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
RELEASE_BRANCH: ${{ github.event.pull_request.head.ref }}

steps:
- name: Create release draft
run: |
version=${RELEASE_BRANCH#release/}
gh release create ${version} --draft --title ${version} --generate-notes
23 changes: 23 additions & 0 deletions .github/workflows/released.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Released

on:
release:
types: [ released ]

jobs:
tweet:
runs-on: ubuntu-20.04
timeout-minutes: 5

steps:
- name: Tweet
uses: snow-actions/[email protected]
with:
status: |
Release ${{ github.event.release.name }} · ${{ github.repository }}
${{ github.event.release.html_url }}
env:
CONSUMER_API_KEY: ${{ secrets.TWITTER_CONSUMER_API_KEY }}
CONSUMER_API_SECRET_KEY: ${{ secrets.TWITTER_CONSUMER_API_SECRET_KEY }}
ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }}
ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}

0 comments on commit b2d06d6

Please sign in to comment.