opensuse images release #988
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: opensuse images release | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- '**' | |
schedule: | |
- cron: "59 23 * * *" | |
jobs: | |
once: | |
runs-on: ubuntu-20.04 | |
name: Create GitHub release | |
outputs: | |
upload_url: ${{ steps.create_release.outputs.upload_url }}${{ steps.create_nightly.outputs.upload_url }} | |
steps: | |
- name: Create Release | |
id: create_release | |
if: startsWith(github.ref, 'refs/tags/v') | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: ${{ github.ref }} | |
draft: true | |
prerelease: false | |
- uses: dev-drprasad/[email protected] | |
if: startsWith(github.ref, 'refs/tags/v') != true | |
with: | |
delete_release: true # default: false | |
tag_name: nightly # tag name to delete | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Tag snapshot | |
if: startsWith(github.ref, 'refs/tags/v') != true | |
uses: tvdias/[email protected] | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
tag: nightly | |
- name: Create Release | |
id: create_nightly | |
if: startsWith(github.ref, 'refs/tags/v') != true | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: nightly | |
release_name: nightly | |
draft: false | |
prerelease: true | |
build: | |
runs-on: ubuntu-20.04 | |
needs: once | |
steps: | |
- name: Get current date | |
run: echo "current_date=$(date +'%Y%m%d')" >> $GITHUB_ENV | |
- name: Set suffix | |
run: echo "release_suffix=_${{ env.current_date }}" >> $GITHUB_ENV | |
- name: Set nightly version | |
if: startsWith(github.ref, 'refs/tags/v') != true | |
run: echo "version=nightly" >> $GITHUB_ENV | |
- name: Set version | |
if: startsWith(github.ref, 'refs/tags/v') == true | |
run: echo "version=$(echo ${{ github.ref }} | rev | cut -d'/' -f1 | rev)" >> $GITHUB_ENV | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Create build dir | |
run: mkdir -p /tmp/build-results | |
- name: Download official rootfs | |
run: wget -P data/ https://download.opensuse.org/repositories/home:/alefnode:/GSI-Phone/images/openSUSE-Tumbleweed-ARM-PHOSH.aarch64-gsi-volla-yggdrasil.aarch64.tar.xz | |
- name: Create ZIP file to flash with Recovery | |
run: zip -r /tmp/build-results/openSUSE-Tumbleweed-ARM-PHOSH.aarch64-gsi-volla-yggdrasil.aarch64${{ env.release_suffix }}.zip * | |
- name: Upload Rootfs image | |
id: upload-rootfs | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.once.outputs.upload_url }} | |
asset_path: /tmp/build-results/openSUSE-Tumbleweed-ARM-PHOSH.aarch64-gsi-volla-yggdrasil.aarch64${{ env.release_suffix }}.zip | |
asset_name: openSUSE-Tumbleweed-ARM-PHOSH.aarch64-gsi-volla-yggdrasil.aarch64${{ env.release_suffix }}.zip | |
asset_content_type: application/gzip |