Skip to content

Commit

Permalink
Add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
dz0ny committed Nov 6, 2019
1 parent 47b72da commit cb47195
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 15 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

name: Upload Release Asset

jobs:
build:
name: Upload Release Asset
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@master
- name: Build project # This would actually build your project, using zip for an example artifact
run: make build
- name: Create Release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: build/woocart-defaults.zip
asset_name: woocart-defaults.zip
asset_content_type: application/zip
16 changes: 1 addition & 15 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
VERSION := 3.11.0
VERSION := 3.11.1
PLUGINSLUG := woocart-defaults
SRCPATH := $(shell pwd)/src

bin/linux/amd64/github-release:
wget https://github.com/aktau/github-release/releases/download/v0.7.2/linux-amd64-github-release.tar.bz2
tar -xvf linux-amd64-github-release.tar.bz2
chmod +x bin/linux/amd64/github-release
rm linux-amd64-github-release.tar.bz2

ensure: vendor
vendor: src/vendor
composer install --dev
Expand Down Expand Up @@ -43,14 +37,6 @@ build: ensure
sed -i "s/${VERSION}/@##VERSION##@/" src/index.php
sed -i "s/${VERSION}/@##VERSION##@/" src/classes/class-release.php

publish: build bin/linux/amd64/github-release
bin/linux/amd64/github-release upload \
--user woocart \
--repo $(PLUGINSLUG) \
--tag "v$(VERSION)" \
--name $(PLUGINSLUG)-$(VERSION).zip \
--file build/$(PLUGINSLUG).zip

release:
git stash
git fetch -p
Expand Down

0 comments on commit cb47195

Please sign in to comment.