Skip to content

Commit

Permalink
CI: Releases based on OPL_VERSION and git tags
Browse files Browse the repository at this point in the history
  • Loading branch information
rickgaiser committed Jan 2, 2021
1 parent 89d6225 commit 4b370ad
Showing 1 changed file with 54 additions and 24 deletions.
78 changes: 54 additions & 24 deletions .github/workflows/compilation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,31 @@ jobs:
run: |
apk add build-base git zip gawk
- uses: actions/checkout@v2
- name: git checkout
uses: actions/checkout@v2
- run: |
git fetch --prune --unshallow
- name: Get version
id: version
run: echo "::set-output name=version::$(make oplversion)"

- name: Compile -> make clean release
run: |
make --trace clean release
mv OPNPS2LD-*.ZIP OPNPS2LD.ZIP
- name: Upload release artifact
- name: Create detailed changelog
run: sh ./make_changelog.sh

- name: Upload release artifact ELF
if: ${{ success() }}
uses: actions/upload-artifact@v2
with:
name: OPNPS2LD
path: OPNPS2LD.ZIP

- name: Create detailed changelog
run: sh ./make_changelog.sh
path: |
OPNPS2LD-*.ELF
- name: Upload changelog for variants artifact
- name: Upload release artifact info
if: ${{ success() }}
uses: actions/upload-artifact@v2
with:
name: OPNPS2LD-VARIANTS
name: INFO
path: |
DETAILED_CHANGELOG
CREDITS
Expand All @@ -63,7 +60,8 @@ jobs:
run: |
apk add build-base git
- uses: actions/checkout@v2
- name: git checkout
uses: actions/checkout@v2
- run: |
git fetch --prune --unshallow
Expand All @@ -74,21 +72,33 @@ jobs:
- name: Compile -> make ${{ matrix.t10k }} ${{ matrix.igs }} ${{ matrix.pademu }} ${{ matrix.rtl }} NOT_PACKED=1
run: |
make --trace ${{ matrix.t10k }} ${{ matrix.igs }} ${{ matrix.pademu }} ${{ matrix.rtl }} NOT_PACKED=1
mv opl.elf OPNPS2LD-${{ matrix.t10k }}-${{ matrix.igs }}-${{ matrix.pademu }}-${{ matrix.rtl }}-${{ steps.version.outputs.version }}.ELF
mv opl.elf OPNPS2LD-${{ steps.version.outputs.version }}-${{ matrix.t10k }}-${{ matrix.igs }}-${{ matrix.pademu }}-${{ matrix.rtl }}.ELF
- name: Upload variants artifact
- name: Create detailed changelog
run: sh ./make_changelog.sh

- name: Upload variants artifact ELF
if: ${{ success() }}
uses: actions/upload-artifact@v2
with:
name: OPNPS2LD-VARIANTS
path: |
OPNPS2LD*.ELF
create-release:
release:
needs: [build, build-variants]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master'
steps:
- name: git checkout
uses: actions/checkout@v2
- run: |
git fetch --prune --unshallow
- name: Get version
id: version
run: echo "::set-output name=version::$(make oplversion)"

- name: Download release artifact
uses: actions/download-artifact@v1
with:
Expand All @@ -99,17 +109,37 @@ jobs:
with:
name: OPNPS2LD-VARIANTS

- name: Download info artifact
uses: actions/download-artifact@v1
with:
name: INFO

- name: Prepare artifacts for release
run: |
mv OPNPS2LD OPNPS2LD-LATEST.ZIP
7z a -t7z OPNPS2LD-VARIANTS-LATEST.7z OPNPS2LD-VARIANTS/*
cp INFO/* OPNPS2LD/
cp INFO/* OPNPS2LD-VARIANTS/
7z a -t7z OPNPS2LD-${{ steps.version.outputs.version }}.7z OPNPS2LD/*
7z a -t7z OPNPS2LD-VARIANTS-${{ steps.version.outputs.version }}.7z OPNPS2LD-VARIANTS/*
- name: Create release
- name: Create prerelease
if: github.ref == 'refs/heads/master'
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: true
automatic_release_tag: "latest"
title: "Latest development builds"
title: "${{ steps.version.outputs.version }}"
files: |
OPNPS2LD-${{ steps.version.outputs.version }}.7z
OPNPS2LD-VARIANTS-${{ steps.version.outputs.version }}.7z
- name: Create release
if: startsWith(github.ref, 'refs/tags/v')
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: "${{ contains(github.ref, '-rc') }}"
title: "${{ steps.version.outputs.version }}"
files: |
OPNPS2LD-LATEST.ZIP
OPNPS2LD-VARIANTS-LATEST.7z
OPNPS2LD-${{ steps.version.outputs.version }}.7z
OPNPS2LD-VARIANTS-${{ steps.version.outputs.version }}.7z

0 comments on commit 4b370ad

Please sign in to comment.