Merge pull request #54 from misteraddons/dependabot/github_actions/do… #53
Workflow file for this run
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: Reflex Updater | |
on: | |
workflow_call: | |
workflow_dispatch: | |
push: | |
paths: | |
- reflex_updater/** | |
env: | |
CARGO_TERM_COLOR: always | |
GH_TOKEN: '${{ github.token }}' | |
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }} | |
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }} | |
ACTIONSECRET: ${{ secrets.ACTIONSECRET }} | |
jobs: | |
build: | |
name: Build | |
strategy: | |
matrix: | |
target: [ armv7-unknown-linux-musleabihf, x86_64-unknown-linux-musl] | |
host: [ ubuntu-latest ] | |
cross: [ true ] | |
include: | |
- target: x86_64-apple-darwin | |
host: macos-latest | |
cross: false | |
- target: x86_64-pc-windows-msvc | |
host: windows-latest | |
cross: false | |
runs-on: ${{ matrix.host }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: ${{ matrix.target }} | |
- run: cargo install cross --git https://github.com/cross-rs/cross | |
if: ${{ matrix.cross }} | |
- run: cross build --release --target ${{ matrix.target }} | |
if: ${{ matrix.cross }} | |
working-directory: reflex_updater | |
- run: cargo build --release --target ${{ matrix.target }} | |
if: ${{ !matrix.cross }} | |
working-directory: reflex_updater | |
#- name: Sign | |
# if: ${{ matrix.host == 'macos-latest' && env.MACOS_CERTIFICATE_PWD != '' }} | |
# run: | | |
# echo $MACOS_CERTIFICATE_PWD | base64 --decode > certificate.pwd | |
# echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12 | |
# version=0.22.0 | |
# release="apple-codesign-${version}-x86_64-apple-darwin" | |
# tag="apple-codesign/$version" | |
# asset="${release}.tar.gz" | |
# gh release download --repo=github.com/indygreg/apple-platform-rs "$tag" --pattern "$asset" | |
# tar --extract --directory . --strip-components 1 --file "$asset" "${release}"/rcodesign | |
# ./rcodesign sign --p12-file certificate.p12 --p12-password-file certificate.pwd reflex_updater/target/${{ matrix.target }}/release/reflex_updater | |
- uses: actions/upload-artifact@v3 | |
if: ${{ matrix.host == 'windows-latest' }} | |
with: | |
name: ${{ matrix.target }} | |
path: | | |
reflex_updater/target/${{ matrix.target }}/release/reflex_updater.exe | |
reflex_updater/target/${{ matrix.target }}/release/reflex_updater.pdb | |
if-no-files-found: error | |
- uses: actions/upload-artifact@v3 | |
if: ${{ matrix.host != 'windows-latest' }} | |
with: | |
name: ${{ matrix.target }} | |
path: reflex_updater/target/${{ matrix.target }}/release/reflex_updater | |
if-no-files-found: error | |
bundle: | |
name: Bundle | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
with: | |
path: artifacts | |
- name: Display structure of downloaded files | |
run: ls -lR | |
working-directory: artifacts | |
- name: Upload | |
uses: actions/upload-artifact@v3 | |
with: | |
name: reflex_updater | |
path: artifacts/ | |
if-no-files-found: error | |