From 8274b2ff0392eca605520e15ebf861bba969dce6 Mon Sep 17 00:00:00 2001 From: "Zee V. (Philip)" Date: Sat, 19 Dec 2020 23:36:45 +0100 Subject: [PATCH] pipeline: add workflows for all release channels --- .github/workflows/alpha.yml | 39 +++++++++++++++++++ .github/workflows/beta.yml | 39 +++++++++++++++++++ .../workflows/{releases.yml => stable.yml} | 18 ++++----- 3 files changed, 86 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/alpha.yml create mode 100644 .github/workflows/beta.yml rename .github/workflows/{releases.yml => stable.yml} (76%) diff --git a/.github/workflows/alpha.yml b/.github/workflows/alpha.yml new file mode 100644 index 0000000..2fbf997 --- /dev/null +++ b/.github/workflows/alpha.yml @@ -0,0 +1,39 @@ +on: + push: + tags: + - "v*.*.*-alpha.*" # push events matching i.e. v9.0.3-alpha.1 + +name: Alpha Release +jobs: + build: + name: Build Release + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Extract version from reference + id: version + run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3) + - name: Build project into an archive + run: | + git archive --format zip --prefix Loot/ --output ./Loot@${{ steps.version.outputs.VERSION }}.zip HEAD + - name: Create release on GitHub + 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: true + - name: Attach assets to GitHub release + 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 }} # 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: ./Loot@${{ steps.version.outputs.VERSION }}.zip + asset_name: Loot@${{ steps.version.outputs.VERSION }}.zip + asset_content_type: application/zip diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml new file mode 100644 index 0000000..32ab72e --- /dev/null +++ b/.github/workflows/beta.yml @@ -0,0 +1,39 @@ +on: + push: + tags: + - "v*.*.*-beta.*" # push events matching i.e. v9.0.3-beta.1 + +name: Beta Release +jobs: + build: + name: Build Release + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Extract version from reference + id: version + run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3) + - name: Build project into an archive + run: | + git archive --format zip --prefix Loot/ --output ./Loot@${{ steps.version.outputs.VERSION }}.zip HEAD + - name: Create release on GitHub + 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: true + - name: Attach assets to GitHub release + 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 }} # 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: ./Loot@${{ steps.version.outputs.VERSION }}.zip + asset_name: Loot@${{ steps.version.outputs.VERSION }}.zip + asset_content_type: application/zip diff --git a/.github/workflows/releases.yml b/.github/workflows/stable.yml similarity index 76% rename from .github/workflows/releases.yml rename to .github/workflows/stable.yml index 3707e2c..bc6ac62 100644 --- a/.github/workflows/releases.yml +++ b/.github/workflows/stable.yml @@ -1,25 +1,23 @@ 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 + - "v*.*.*-stable.*" # push events matching i.e. v9.0.3-stable.1 +name: Stable Release jobs: build: - name: Upload Release Asset + name: Build Release runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v2 - - name: Extract version + - name: Extract version from reference id: version run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3) - - name: Build project # This would actually build your project, using zip for an example artifact + - name: Build project into an archive run: | git archive --format zip --prefix Loot/ --output ./Loot@${{ steps.version.outputs.VERSION }}.zip HEAD - - name: Create Release + - name: Create release on GitHub id: create_release uses: actions/create-release@v1 env: @@ -27,9 +25,9 @@ jobs: with: tag_name: ${{ github.ref }} release_name: ${{ github.ref }} - draft: false + draft: true prerelease: false - - name: Upload Release Asset + - name: Attach assets to GitHub release id: upload-release-asset uses: actions/upload-release-asset@v1 env: