You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
alfred-gemoji/.github/workflows/release.yml

47 lines
1.4 KiB

2 years ago
name: Release
on:
push:
branches:
- main
paths:
- Gemfile.lock
2 years ago
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
2 years ago
- run: bundle exec rake
- run: cd build && zip -rq ../emoji.alfredsnippets .
2 years ago
- id: date
run: echo "DATE=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: Create release
run: |
UPLOAD_URL="$(
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ github.repository }}/releases \
-d '{"tag_name":"${{ steps.date.outputs.DATE }}","target_commitish":"${{ github.action_ref }}"}' \
| jq --raw-output .upload_url)"
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
-H "Content-Type: application/zip" \
"${UPLOAD_URL/'{?name,label}'/?name=emoji.alfredsnippets}" \
--data-binary "@emoji.alfredsnippets"