diff options
author | Benjamin Brahmer <info@b-brahmer.de> | 2020-12-17 16:01:23 +0100 |
---|---|---|
committer | Benjamin Brahmer <info@b-brahmer.de> | 2020-12-17 16:01:23 +0100 |
commit | 090db22cdba546e24f113fce5bfa7e303954cf08 (patch) | |
tree | 29235639fa1675141d52296ec3363c338733b646 | |
parent | 11f5904dd58cbcb45e0e3e6c466f187e30323155 (diff) |
fully automate release
Signed-off-by: Benjamin Brahmer <info@b-brahmer.de>
-rw-r--r-- | .github/workflows/build-release.yml | 39 | ||||
-rw-r--r-- | .github/workflows/create-release.yml | 61 |
2 files changed, 61 insertions, 39 deletions
diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml deleted file mode 100644 index 44751fcf0..000000000 --- a/.github/workflows/build-release.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Build and publish app release - -on: - release: - types: [published] - -env: - APP_NAME: news - -jobs: - build_and_publish: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - path: ${{ env.APP_NAME }} - - name: Run build - run: cd ${{ env.APP_NAME }} && make && make appstore - env: - app_private_key: ${{ secrets.APP_PRIVATE_KEY }} - app_public_cert: ${{ secrets.APP_PUBLIC_CERT }} - - name: Upload app tarball to release - uses: svenstaro/upload-release-action@v2 - id: attach_to_release - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: ${{ env.APP_NAME }}/build/artifacts/appstore/${{ env.APP_NAME }}.tar.gz - asset_name: ${{ env.APP_NAME }}.tar.gz - tag: ${{ github.ref }} - overwrite: true - - name: Upload app to Nextcloud appstore - uses: R0Wi/nextcloud-appstore-push-action@v1 - with: - app_name: ${{ env.APP_NAME }} - appstore_token: ${{ secrets.APPSTORE_TOKEN }} - download_url: ${{ steps.attach_to_release.outputs.browser_download_url }} - app_private_key: ${{ secrets.APP_PRIVATE_KEY }} - nightly: ${{ github.event.release.prerelease }}
\ No newline at end of file diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml new file mode 100644 index 000000000..f0973be8f --- /dev/null +++ b/.github/workflows/create-release.yml @@ -0,0 +1,61 @@ +on: + push: + # Sequence of patterns matched against refs/tags + tags: + - '15.*' # Push events to matching v*, i.e. v1.0, v20.15.10 + +name: Create Release + +jobs: + build: + name: Create Release + runs-on: ubuntu-latest + steps: + - name: Get version from tag + id: tag_name + run: | + echo ::set-output name=current_version::${GITHUB_REF/refs\/tags\//} + shell: bash + - name: Checkout code + uses: actions/checkout@v2 + - name: Get Changelog Entry + id: changelog_reader + uses: mindsers/changelog-reader-action@v2 + with: + version: ${{ steps.tag_name.outputs.current_version }} + path: ./CHANGELOG.md + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + # This pulls from the "Get Changelog Entry" step above, referencing it's ID to get its outputs object. + # See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + tag_name: ${{ steps.changelog_reader.outputs.version }} + release_name: Release ${{ steps.changelog_reader.outputs.version }} + body: ${{ steps.changelog_reader.outputs.changes }} + prerelease: ${{ steps.changelog_reader.outputs.status == 'prereleased' }} + draft: ${{ steps.changelog_reader.outputs.status == 'unreleased' }} + - name: Run build + run: make && make appstore + env: + app_private_key: ${{ secrets.APP_PRIVATE_KEY }} + app_public_cert: ${{ secrets.APP_PUBLIC_CERT }} + - name: Upload app tarball to release + uses: svenstaro/upload-release-action@v2 + id: attach_to_release + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: ./build/artifacts/appstore/news.tar.gz + asset_name: news.tar.gz + tag: ${{ github.ref }} + overwrite: true + - name: Upload app to Nextcloud appstore + uses: R0Wi/nextcloud-appstore-push-action@v1 + with: + app_name: news + appstore_token: ${{ secrets.APPSTORE_TOKEN }} + download_url: ${{ steps.attach_to_release.outputs.browser_download_url }} + app_private_key: ${{ secrets.APP_PRIVATE_KEY }} + nightly: ${{ github.event.release.prerelease }}
\ No newline at end of file |