Skip to content

Commit

Permalink
build: Change releasing steps
Browse files Browse the repository at this point in the history
  • Loading branch information
lens0021 committed Jul 20, 2020
1 parent 0ca41e4 commit dfe8c12
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 29 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/release-and-submit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

name: Upload Release Asset and submit a PR to docker-mediawiki repository

jobs:
build:
runs-on: ubuntu-18.04
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/[email protected]
with:
php-version: '7.3'
tools: composer:v1
- name: Set tag name
id: tag_name
run: echo "::set-output name=tag_name::$(basename ${{ github.ref }})"
- name: Build project
run: |
composer update --no-dev
yarn --prod
tar --exclude-vcs -C .. -zcvf "../${{ steps.tag_name.outputs.tag_name }}.tar.gz" "$(basename "$(pwd)")"
mv ../${{ steps.tag_name.outputs.tag_name }}.tar.gz ./
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ steps.tag_name.outputs.tag_name }}.tar.gz
asset_name: ${{ steps.tag_name.outputs.tag_name }}.tar.gz
asset_content_type: application/zip
- name: Submit a PR
run: |
curl \
--fail \
--request POST \
--url https://api.github.com/repos/femiwiki/docker-mediawiki/dispatches \
--header "Authorization: token ${{ secrets.BOT_TOKEN }}" \
--header 'content-type: application/json' \
--data '{
"event_type": "bump-extension",
"client_payload": {
"extension": "${{ github.event.repository.name }}",
"version": "${{ steps.tag_name.outputs.tag_name }}"
}
}'
29 changes: 0 additions & 29 deletions .github/workflows/submit-patch.yml

This file was deleted.

0 comments on commit dfe8c12

Please sign in to comment.