Skip to content

Commit

Permalink
Update all usages of artifacts in jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
filips123 committed Oct 9, 2024
1 parent 891addc commit 6a3fd59
Showing 1 changed file with 65 additions and 32 deletions.
97 changes: 65 additions & 32 deletions .github/workflows/native.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -315,23 +315,23 @@ jobs:
if: matrix.target == 'x86_64-unknown-linux-gnu'
uses: actions/upload-artifact@v4
with:
name: build-shell-completions
name: build-artifacts-shell-completions
path: native/target/completions.zip
compression-level: 0

- name: Upload DEB (Linux)
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v4
with:
name: build-linux-deb-${{ steps.target.outputs.target }}
name: build-artifacts-linux-deb-${{ steps.target.outputs.target }}
path: native/target/debian/*.deb
compression-level: 0

- name: Upload RPM (Linux)
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v4
with:
name: build-linux-rpm-${{ steps.target.outputs.target }}
name: build-artifacts-linux-rpm-${{ steps.target.outputs.target }}
path: native/target/rpm/*.rpm
compression-level: 0

Expand All @@ -340,7 +340,7 @@ jobs:
if: matrix.os == 'windows-latest' && matrix.portable != true
uses: actions/upload-artifact@v4
with:
name: unsigned-windows-msi-${{ steps.target.outputs.target }}
name: unsigned-artifacts-windows-msi-${{ steps.target.outputs.target }}
path: native/target/wix/*.msi
compression-level: 0

Expand All @@ -349,27 +349,27 @@ jobs:
if: matrix.os == 'windows-latest' && matrix.portable == true
uses: actions/upload-artifact@v4
with:
name: unsigned-windows-paf-${{ steps.target.outputs.target }}
name: unsigned-artifacts-windows-paf-${{ steps.target.outputs.target }}
path: native/target/paf/*.paf.exe
compression-level: 0

- name: Sign MSI (Windows)
# if: startsWith(github.ref, 'refs/tags/v')
- name: Sign MSI with SignPath (Windows)
if: matrix.os == 'windows-latest' && matrix.portable != true # && startsWith(github.ref, 'refs/tags/v')
uses: signpath/github-action-submit-signing-request@v1
with:
api-token: ${{ secrets.SIGNPATH_API_TOKEN }}
api-token: ${{ secrets.SIGNPATH_TOKEN }}
organization-id: ${{ vars.SIGNPATH_ORGANIZATION_ID }}
project-slug: ${{ vars.SIGNPATH_PROJECT_SLUG }}
signing-policy-slug: ${{ vars.SIGNPATH_POLICY_SLUG }}
github-artifact-id: ${{ steps.artifact-unsigned-msi.outputs.artifact-id }}
artifact-configuration-slug: installer
output-artifact-directory: signed/msi

- name: Sign PAF (Windows)
# if: startsWith(github.ref, 'refs/tags/v')
- name: Sign PAF with SignPath (Windows)
if: matrix.os == 'windows-latest' && matrix.portable == true # && startsWith(github.ref, 'refs/tags/v')
uses: signpath/github-action-submit-signing-request@v1
with:
api-token: ${{ secrets.SIGNPATH_API_TOKEN }}
api-token: ${{ secrets.SIGNPATH_TOKEN }}
organization-id: ${{ vars.SIGNPATH_ORGANIZATION_ID }}
project-slug: ${{ vars.SIGNPATH_PROJECT_SLUG }}
signing-policy-slug: ${{ vars.SIGNPATH_POLICY_SLUG }}
Expand All @@ -381,15 +381,15 @@ jobs:
if: matrix.os == 'windows-latest' && matrix.portable != true # && startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-artifact@v4
with:
name: build-windows-msi-${{ steps.target.outputs.target }}
name: build-artifacts-windows-msi-${{ steps.target.outputs.target }}
path: signed/msi/*.msi
compression-level: 0

- name: Upload signed PAF (Windows)
if: matrix.os == 'windows-latest' && matrix.portable == true # && startsWith(github.ref, 'refs/tags/v')
uses: actions/upload-artifact@v4
with:
name: build-windows-paf-${{ steps.target.outputs.target }}
name: build-artifacts-windows-paf-${{ steps.target.outputs.target }}
path: signed/paf/*.paf.exe
compression-level: 0

Expand All @@ -411,25 +411,33 @@ jobs:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest

permissions:
actions: read
contents: write

needs:
- clippy
- rustfmt
- build

steps:
- name: Download artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
pattern: build-artifact-*
path: artifacts
merge-multiple: true

- name: Upload artifacts to GitHub Release
uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191
with:
fail_on_unmatched_files: true
files: |
artifact/completions.zip
artifact/debian/*.deb
artifact/rpm/*.rpm
artifact/wix/*.msi
artifact/paf/*.paf.exe
artifacts/completions.zip
artifacts/*.deb
artifacts/*.rpm
artifacts/*.msi
artifacts/*.paf.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -438,14 +446,22 @@ jobs:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest

permissions:
actions: read
contents: read

needs:
- clippy
- rustfmt
- build

steps:
- name: Download artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
pattern: build-artifact-linux-*
path: artifacts
merge-multiple: true

- name: Install packagecloud.io CLI
run: sudo gem install package_cloud
Expand All @@ -454,15 +470,18 @@ jobs:
env:
PACKAGECLOUD_TOKEN: ${{ secrets.PACKAGECLOUD_TOKEN }}
run: |
package_cloud push filips/FirefoxPWA/any/any artifact/debian/*.deb
package_cloud push filips/FirefoxPWA/rpm_any/rpm_any artifact/rpm/*.rpm
package_cloud push filips/FirefoxPWA/any/any artifacts/*.deb
package_cloud push filips/FirefoxPWA/rpm_any/rpm_any artifacts/*.rpm
release-aur:
name: Release on Arch User Repository
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
container: archlinux

permissions:
contents: read

needs:
- release-github

Expand Down Expand Up @@ -502,8 +521,8 @@ jobs:
pkgbuild: ./native/packages/aur/firefox-pwa/PKGBUILD
assets: ./native/packages/aur/firefox-pwa/**
commit_message: Update to ${{ env.VERSION }}
commit_username: ${{ secrets.AUR_USERNAME }}
commit_email: ${{ secrets.AUR_EMAIL }}
commit_username: ${{ vars.AUR_USERNAME }}
commit_email: ${{ vars.AUR_EMAIL }}
ssh_private_key: ${{ secrets.AUR_PRIVATE_KEY }}
ssh_keyscan_types: rsa,ecdsa,ed25519

Expand All @@ -514,8 +533,8 @@ jobs:
pkgbuild: ./native/packages/aur/firefox-pwa-bin/PKGBUILD
assets: ./native/packages/aur/firefox-pwa-bin/**
commit_message: Update to ${{ env.VERSION }}
commit_username: ${{ secrets.AUR_USERNAME }}
commit_email: ${{ secrets.AUR_EMAIL }}
commit_username: ${{ vars.AUR_USERNAME }}
commit_email: ${{ vars.AUR_EMAIL }}
ssh_private_key: ${{ secrets.AUR_PRIVATE_KEY }}
ssh_keyscan_types: rsa,ecdsa,ed25519

Expand All @@ -525,6 +544,9 @@ jobs:
runs-on: ubuntu-latest
container: ghcr.io/filips123/gentoo-pycargoebuild

permissions:
contents: read

needs:
- release-github

Expand Down Expand Up @@ -554,8 +576,8 @@ jobs:
- name: Prepare Git user
working-directory: tmp/guru
run: |
git config --local user.name "${{ secrets.GENTOO_USERNAME }}"
git config --local user.email "${{ secrets.GENTOO_EMAIL }}"
git config --local user.name "${{ vars.GENTOO_USERNAME }}"
git config --local user.email "${{ vars.GENTOO_EMAIL }}"
git config --local user.signingkey "${{ secrets.GENTOO_KEY_ID }}"
- name: Prepare Git settings
Expand Down Expand Up @@ -609,6 +631,9 @@ jobs:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: windows-latest

permissions:
contents: read

needs:
- release-github

Expand All @@ -619,8 +644,8 @@ jobs:

- name: Prepare Git user
run: |
git config --global user.name "${{ secrets.GH_USERNAME }}"
git config --global user.email "${{ secrets.GH_EMAIL }}"
git config --global user.name "${{ vars.WINGET_USERNAME }}"
git config --global user.email "${{ vars.WINGET_EMAIL }}"
- name: Update and release package manifest
run: |
Expand All @@ -634,6 +659,10 @@ jobs:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: windows-latest

permissions:
actions: read
contents: read

needs:
- release-github

Expand All @@ -642,12 +671,16 @@ jobs:
uses: actions/checkout@v4

- name: Download artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
pattern: build-artifact-windows-msi-*
path: artifacts
merge-multiple: true

- name: Calculate version and installer checksums
run: |
echo "::group::Copying installers to the package"
cp -R artifact/wix/*.msi native/packages/choco/tools/
cp -R artifacts/*.msi native/packages/choco/tools/
echo "::endgroup::"
echo "::group::Setting the package version"
Expand Down

0 comments on commit 6a3fd59

Please sign in to comment.