Skip to content

github actions release workflow overwrite assets for alphas #18

github actions release workflow overwrite assets for alphas

github actions release workflow overwrite assets for alphas #18

name: release-installer
on:
release:
types:
- published
- prereleased
push:
branches: ["develop"] # TODO: switch this to master
workflow_run:
workflows: ["pre-release"]
types:
- completed
jobs:
windows:
runs-on: windows-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
# install stuff and run tests
- uses: ./.github/run-tests
# default the tag to the current ref, or use the testing tag
- run: echo "RELEASE_TAG=${{ github.ref }}" >> $GITHUB_ENV
shell: bash
- if: ${{ startsWith(github.ref, 'refs/heads/') }}
run: echo "RELEASE_TAG=testing" >> $GITHUB_ENV
shell: bash
# upload assets to release
- name: Upload Release Asset DXRando
id: upload-release-asset-dxrando
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: installer/dist/DXRandoInstaller.exe
asset_name: DXRandoInstaller.exe
tag: ${{ env.RELEASE_TAG }}
overwrite: true
- name: Upload Release Asset BingoViewer
id: upload-release-asset-bingoviewer
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: installer/dist/BingoViewer.exe
asset_name: BingoViewer.exe
tag: ${{ env.RELEASE_TAG }}
overwrite: true
linux:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Check out repository code
uses: actions/checkout@v4
# install stuff and run tests
- run: sudo apt-get update -y
- run: sudo apt-get install -y python3-tk idle3 binutils
- uses: ./.github/run-tests
# default the tag to the current ref, or use the testing tag
- run: echo "RELEASE_TAG=${{ github.ref }}" >> $GITHUB_ENV
shell: bash
- if: ${{ startsWith(github.ref, 'refs/heads/') }}
run: echo "RELEASE_TAG=testing" >> $GITHUB_ENV
shell: bash
# update our testing tag
- if: ${{ startsWith(github.ref, 'refs/heads/') }}
name: Update tag
uses: actions/github-script@v7
with:
script: |
github.rest.git.updateRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'tags/testing',
sha: context.sha
})
# upload assets to release
- name: Upload Release Asset DXRando
id: upload-release-asset-dxrando
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: installer/dist/DXRandoInstaller
asset_name: DXRandoInstaller-Linux
tag: ${{ env.RELEASE_TAG }}
overwrite: true
- name: Upload Release Asset BingoViewer
id: upload-release-asset-bingoviewer
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: installer/dist/BingoViewer
asset_name: BingoViewer-Linux
tag: ${{ env.RELEASE_TAG }}
overwrite: true